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/backends/BackendProfiling.hpp | 49 +++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 src/profiling/backends/BackendProfiling.hpp (limited to 'src/profiling/backends/BackendProfiling.hpp') 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 +#include + +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 + GetCounterRegistrationInterface(uint16_t currentMaxGlobalCounterID) override; + + std::unique_ptr GetSendTimelinePacket() override; + + IProfilingGuidGenerator& GetProfilingGuidGenerator() override; + + void ReportCounters(const std::vector&) override + {} + + CounterStatus GetCounterStatus(uint16_t backendCounterId) override; + + std::vector 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 -- cgit v1.2.1