From 1aff393b359b518925f66901439466f9bc14c49d Mon Sep 17 00:00:00 2001 From: Colm Donelan Date: Wed, 5 Feb 2020 17:48:59 +0000 Subject: 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 Change-Id: I975eaa2093ae91fa623835f65f9e5b25eb65117a --- src/profiling/ProfilingService.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/profiling/ProfilingService.hpp') diff --git a/src/profiling/ProfilingService.hpp b/src/profiling/ProfilingService.hpp index e510589caa..4438952853 100644 --- a/src/profiling/ProfilingService.hpp +++ b/src/profiling/ProfilingService.hpp @@ -22,6 +22,7 @@ #include "SendCounterPacket.hpp" #include "SendTimelinePacket.hpp" #include "TimelinePacketWriterFactory.hpp" +#include namespace armnn { @@ -63,6 +64,13 @@ public: // Disconnects the profiling service from the external server void Disconnect(); + // Store a profiling context returned from a backend that support profiling. + void AddBackendProfilingContext(const BackendId backendId, + std::shared_ptr profilingContext) + { + m_BackendProfilingContexts.emplace(backendId, std::move(profilingContext)); + } + const ICounterDirectory& GetCounterDirectory() const; ICounterRegistry& GetCounterRegistry(); ProfilingState GetCurrentState() const; @@ -132,6 +140,8 @@ private: PerJobCounterSelectionCommandHandler m_PerJobCounterSelectionCommandHandler; ProfilingGuidGenerator m_GuidGenerator; TimelinePacketWriterFactory m_TimelinePacketWriterFactory; + std::unordered_map> m_BackendProfilingContexts; protected: // Default constructor/destructor kept protected for testing -- cgit v1.2.1