aboutsummaryrefslogtreecommitdiff
path: root/src/profiling/backends
diff options
context:
space:
mode:
Diffstat (limited to 'src/profiling/backends')
-rw-r--r--src/profiling/backends/BackendProfiling.cpp18
-rw-r--r--src/profiling/backends/BackendProfiling.hpp9
2 files changed, 22 insertions, 5 deletions
diff --git a/src/profiling/backends/BackendProfiling.cpp b/src/profiling/backends/BackendProfiling.cpp
index 884fb3f2ff..0926879f67 100644
--- a/src/profiling/backends/BackendProfiling.cpp
+++ b/src/profiling/backends/BackendProfiling.cpp
@@ -29,6 +29,24 @@ IProfilingGuidGenerator& BackendProfiling::GetProfilingGuidGenerator()
return m_ProfilingService;
}
+void BackendProfiling::ReportCounters(const std::vector<Timestamp>& timestamps)
+{
+ for (const auto timestampInfo : timestamps)
+ {
+ std::vector<CounterValue> backendCounterValues = timestampInfo.counterValues;
+ for_each(backendCounterValues.begin(), backendCounterValues.end(), [&](CounterValue& backendCounterValue)
+ {
+ // translate the counterId to globalCounterId
+ backendCounterValue.counterId = m_ProfilingService.GetCounterMappings().GetGlobalId(
+ backendCounterValue.counterId, m_BackendId);
+ });
+
+ // Send Periodic Counter Capture Packet for the Timestamp
+ m_ProfilingService.GetSendCounterPacket().SendPeriodicCounterCapturePacket(
+ timestampInfo.timestamp, backendCounterValues);
+ }
+}
+
CounterStatus BackendProfiling::GetCounterStatus(uint16_t backendCounterId)
{
uint16_t globalCounterId = m_ProfilingService.GetCounterMappings().GetGlobalId(backendCounterId, m_BackendId);
diff --git a/src/profiling/backends/BackendProfiling.hpp b/src/profiling/backends/BackendProfiling.hpp
index e0e0f58e7d..c0f3eea978 100644
--- a/src/profiling/backends/BackendProfiling.hpp
+++ b/src/profiling/backends/BackendProfiling.hpp
@@ -5,7 +5,7 @@
#pragma once
-#include "ProfilingService.hpp"
+#include "IProfilingService.hpp"
#include <armnn/backends/profiling/IBackendProfiling.hpp>
namespace armnn
@@ -18,7 +18,7 @@ class BackendProfiling : public IBackendProfiling
{
public:
BackendProfiling(const IRuntime::CreationOptions& options,
- ProfilingService& profilingService,
+ IProfilingService& profilingService,
const BackendId& backendId)
: m_Options(options),
m_ProfilingService(profilingService),
@@ -34,8 +34,7 @@ public:
IProfilingGuidGenerator& GetProfilingGuidGenerator() override;
- void ReportCounters(const std::vector<Timestamp>&) override
- {}
+ void ReportCounters(const std::vector<Timestamp>&) override;
CounterStatus GetCounterStatus(uint16_t backendCounterId) override;
@@ -45,7 +44,7 @@ public:
private:
IRuntime::CreationOptions m_Options;
- ProfilingService& m_ProfilingService;
+ IProfilingService& m_ProfilingService;
BackendId m_BackendId;
};
} // namespace profiling