diff options
author | Finn Williams <Finn.Williams@arm.com> | 2020-05-15 18:41:05 +0100 |
---|---|---|
committer | finn.williams <finn.williams@arm.com> | 2020-05-19 11:45:57 +0000 |
commit | 45a736263e117b484528e6dee05c549beae721b4 (patch) | |
tree | c674cd5bcd8e22c218c50fadf4c724691c415210 /src/armnn/BackendRegistry.cpp | |
parent | b98032f6a46072fee9a2bfcbe631b8193ced567d (diff) | |
download | armnn-45a736263e117b484528e6dee05c549beae721b4.tar.gz |
IVGCVSW-4834 Add calls to increment REGISTERED_BACKENDS and UNREGISTERED_BACKENDS
Signed-off-by: Finn Williams <Finn.Williams@arm.com>
Change-Id: I3600dd15f97ccd4ab745deb87d06ba978e2a0b11
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 |