aboutsummaryrefslogtreecommitdiff
path: root/src/profiling/backends
diff options
context:
space:
mode:
Diffstat (limited to 'src/profiling/backends')
-rw-r--r--src/profiling/backends/BackendProfiling.cpp48
-rw-r--r--src/profiling/backends/BackendProfiling.hpp49
2 files changed, 97 insertions, 0 deletions
diff --git a/src/profiling/backends/BackendProfiling.cpp b/src/profiling/backends/BackendProfiling.cpp
new file mode 100644
index 0000000000..a49122a7a1
--- /dev/null
+++ b/src/profiling/backends/BackendProfiling.cpp
@@ -0,0 +1,48 @@
+//
+// Copyright © 2020 Arm Ltd. All rights reserved.
+// SPDX-License-Identifier: MIT
+//
+
+#include "BackendProfiling.hpp"
+#include "RegisterBackendCounters.hpp"
+
+namespace armnn
+{
+
+namespace profiling
+{
+
+std::unique_ptr<IRegisterBackendCounters>
+ BackendProfiling::GetCounterRegistrationInterface(uint16_t currentMaxGlobalCounterID)
+{
+ return std::make_unique<RegisterBackendCounters>(RegisterBackendCounters(currentMaxGlobalCounterID, m_backendId));
+}
+
+std::unique_ptr<ISendTimelinePacket> BackendProfiling::GetSendTimelinePacket()
+{
+ return m_ProfilingService.GetSendTimelinePacket();
+}
+
+IProfilingGuidGenerator& BackendProfiling::GetProfilingGuidGenerator()
+{
+ // The profiling service is our Guid Generator.
+ return m_ProfilingService;
+}
+
+CounterStatus BackendProfiling::GetCounterStatus(uint16_t)
+{
+ return CounterStatus();
+}
+
+std::vector<CounterStatus> BackendProfiling::GetActiveCounters()
+{
+ return std::vector<CounterStatus>();
+}
+
+bool BackendProfiling::IsProfilingEnabled() const
+{
+ return m_ProfilingService.IsProfilingEnabled();
+}
+
+} // namespace profiling
+} // namespace armnn
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