aboutsummaryrefslogtreecommitdiff
path: root/src/profiling/backends/BackendProfiling.hpp
diff options
context:
space:
mode:
authorColm Donelan <Colm.Donelan@arm.com>2020-02-05 17:48:59 +0000
committerColm Donelan <colm.donelan@arm.com>2020-02-07 09:28:35 +0000
commit1aff393b359b518925f66901439466f9bc14c49d (patch)
tree9d31aa1d3dabb4b637093f6fd1a9f1549621c653 /src/profiling/backends/BackendProfiling.hpp
parent3446057492907d0c7695605a5b9a961a78158d7e (diff)
downloadarmnn-1aff393b359b518925f66901439466f9bc14c49d.tar.gz
IVGCVSW-4317 Implement the Profiling Context Initialisation
* Call CreateBackendProfilingContext on each backend from Runtime passing an instance of the BackendProfiling interface. * Modify the signature of CreateBackendProfilingContext to remove const and return a shared_ptr to BackendProfilingContext * Add concrete BackendProfiling class. * Store BackendProfilingContexts in Profiling service. Signed-off-by: Colm Donelan <Colm.Donelan@arm.com> Change-Id: I975eaa2093ae91fa623835f65f9e5b25eb65117a
Diffstat (limited to 'src/profiling/backends/BackendProfiling.hpp')
-rw-r--r--src/profiling/backends/BackendProfiling.hpp49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/profiling/backends/BackendProfiling.hpp b/src/profiling/backends/BackendProfiling.hpp
new file mode 100644
index 0000000000..2bc365a1de
--- /dev/null
+++ b/src/profiling/backends/BackendProfiling.hpp
@@ -0,0 +1,49 @@
+//
+// Copyright © 2020 Arm Ltd. All rights reserved.
+// SPDX-License-Identifier: MIT
+//
+
+#include <ProfilingService.hpp>
+#include <armnn/backends/profiling/IBackendProfiling.hpp>
+
+namespace armnn
+{
+
+namespace profiling
+{
+
+class BackendProfiling : public IBackendProfiling
+{
+public:
+ BackendProfiling(const IRuntime::CreationOptions& options, ProfilingService& profilingService, const BackendId& id)
+ : m_options(options)
+ , m_ProfilingService(profilingService)
+ , m_backendId(id)
+ {}
+
+ ~BackendProfiling()
+ {}
+
+ std::unique_ptr<IRegisterBackendCounters>
+ GetCounterRegistrationInterface(uint16_t currentMaxGlobalCounterID) override;
+
+ std::unique_ptr<ISendTimelinePacket> GetSendTimelinePacket() override;
+
+ IProfilingGuidGenerator& GetProfilingGuidGenerator() override;
+
+ void ReportCounters(const std::vector<Timestamp>&) override
+ {}
+
+ CounterStatus GetCounterStatus(uint16_t backendCounterId) override;
+
+ std::vector<CounterStatus> GetActiveCounters() override;
+
+ bool IsProfilingEnabled() const override;
+
+private:
+ IRuntime::CreationOptions m_options;
+ ProfilingService& m_ProfilingService;
+ BackendId m_backendId;
+};
+} // namespace profiling
+} // namespace armnn \ No newline at end of file