diff options
Diffstat (limited to 'src/armnn/BackendRegistry.cpp')
-rw-r--r-- | src/armnn/BackendRegistry.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/armnn/BackendRegistry.cpp b/src/armnn/BackendRegistry.cpp index a79cdd0bb2..ff63c8236a 100644 --- a/src/armnn/BackendRegistry.cpp +++ b/src/armnn/BackendRegistry.cpp @@ -5,6 +5,7 @@ #include <armnn/BackendRegistry.hpp> #include <armnn/Exceptions.hpp> +#include <ProfilingService.hpp> namespace armnn { @@ -24,11 +25,25 @@ void BackendRegistry::Register(const BackendId& id, BackendRegistry::FactoryFunc CHECK_LOCATION()); } m_Factories[id] = factory; + + if (m_ProfilingService.has_value()) + { + if (m_ProfilingService.has_value() && m_ProfilingService.value().IsProfilingEnabled()) + { + m_ProfilingService.value().IncrementCounterValue(armnn::profiling::REGISTERED_BACKENDS); + } + } + } void BackendRegistry::Deregister(const BackendId& id) { m_Factories.erase(id); + + if (m_ProfilingService.has_value() && m_ProfilingService.value().IsProfilingEnabled()) + { + m_ProfilingService.value().IncrementCounterValue(armnn::profiling::UNREGISTERED_BACKENDS); + } } bool BackendRegistry::IsBackendRegistered(const BackendId& id) const @@ -86,5 +101,10 @@ void BackendRegistry::Swap(BackendRegistry& instance, BackendRegistry::FactorySt std::swap(instance.m_Factories, other); } +void BackendRegistry::SetProfilingService(armnn::Optional<profiling::ProfilingService&> profilingService) +{ + m_ProfilingService = profilingService; +} + } // namespace armnn |