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
diff --git a/src/profiling/ProfilingService.hpp b/src/profiling/ProfilingService.hpp
index e510589..4438952 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 <armnn/backends/profiling/IBackendProfilingContext.hpp>
namespace armnn
{
@@ -63,6 +64,13 @@
// 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<armnn::profiling::IBackendProfilingContext> profilingContext)
+ {
+ m_BackendProfilingContexts.emplace(backendId, std::move(profilingContext));
+ }
+
const ICounterDirectory& GetCounterDirectory() const;
ICounterRegistry& GetCounterRegistry();
ProfilingState GetCurrentState() const;
@@ -132,6 +140,8 @@
PerJobCounterSelectionCommandHandler m_PerJobCounterSelectionCommandHandler;
ProfilingGuidGenerator m_GuidGenerator;
TimelinePacketWriterFactory m_TimelinePacketWriterFactory;
+ std::unordered_map<BackendId,
+ std::shared_ptr<armnn::profiling::IBackendProfilingContext>> m_BackendProfilingContexts;
protected:
// Default constructor/destructor kept protected for testing