diff options
author | Keith Davis <keith.davis@arm.com> | 2019-12-02 15:12:19 +0000 |
---|---|---|
committer | Keith Davis <keith.davis@arm.com> | 2019-12-13 16:21:12 +0000 |
commit | e394bd99f1a55e099445823b7a951f0faa84d439 (patch) | |
tree | ced6e6d4a2932bda64c1f4c5e280b82d87b77929 /src/armnn | |
parent | 60a20fb62c992c4c6369bb7f532957f3e151f3d8 (diff) | |
download | armnn-e394bd99f1a55e099445823b7a951f0faa84d439.tar.gz |
IVGCVSW-4178 Add code to increment the 3 ArmNN counters
* Increment at Runtime.cpp | BackendRegistry.cpp | LoadedNetwork.cpp
* Update unit tests
* UID generation is now handled by backends
Signed-off-by: Keith Davis <keith.davis@arm.com>
Change-Id: Ifa53763409078c14839675206d8b260cdc36a8df
Diffstat (limited to 'src/armnn')
-rw-r--r-- | src/armnn/BackendRegistry.cpp | 10 | ||||
-rw-r--r-- | src/armnn/LoadedNetwork.cpp | 4 | ||||
-rw-r--r-- | src/armnn/Runtime.cpp | 9 |
3 files changed, 22 insertions, 1 deletions
diff --git a/src/armnn/BackendRegistry.cpp b/src/armnn/BackendRegistry.cpp index dc3e2bc254..35e82f2e67 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 { @@ -23,12 +24,19 @@ void BackendRegistry::Register(const BackendId& id, BackendRegistry::FactoryFunc std::string(id) + " already registered as IBackend factory", CHECK_LOCATION()); } - + if (profiling::ProfilingService::Instance().IsProfilingEnabled()) + { + profiling::ProfilingService::Instance().IncrementCounterValue(armnn::profiling::REGISTERED_BACKENDS); + } m_Factories[id] = factory; } void BackendRegistry::Deregister(const BackendId& id) { + if (profiling::ProfilingService::Instance().IsProfilingEnabled()) + { + profiling::ProfilingService::Instance().IncrementCounterValue(armnn::profiling::UNREGISTERED_BACKENDS); + } m_Factories.erase(id); } diff --git a/src/armnn/LoadedNetwork.cpp b/src/armnn/LoadedNetwork.cpp index c0f3fec3f5..e915d36e7b 100644 --- a/src/armnn/LoadedNetwork.cpp +++ b/src/armnn/LoadedNetwork.cpp @@ -462,6 +462,10 @@ Status LoadedNetwork::EnqueueWorkload(const InputTensors& inputTensors, bool executionSucceeded = true; { + if (profiling::ProfilingService::Instance().IsProfilingEnabled()) + { + profiling::ProfilingService::Instance().IncrementCounterValue(armnn::profiling::INFERENCES_RUN); + } ARMNN_SCOPED_PROFILING_EVENT(Compute::Undefined, "Execute"); ARMNN_SCOPED_HEAP_PROFILING("Executing"); executionSucceeded = Execute(timelineUtils, inferenceGuid); diff --git a/src/armnn/Runtime.cpp b/src/armnn/Runtime.cpp index 4ad6fa59a0..1e3e232046 100644 --- a/src/armnn/Runtime.cpp +++ b/src/armnn/Runtime.cpp @@ -92,6 +92,11 @@ Status Runtime::LoadNetwork(NetworkId& networkIdOut, context.second->AfterLoadNetwork(networkIdOut); } + if (profiling::ProfilingService::Instance().IsProfilingEnabled()) + { + profiling::ProfilingService::Instance().IncrementCounterValue(armnn::profiling::NETWORK_LOADS); + } + return Status::Success; } @@ -118,6 +123,10 @@ Status Runtime::UnloadNetwork(NetworkId networkId) ARMNN_LOG(warning) << "WARNING: Runtime::UnloadNetwork(): " << networkId << " not found!"; return Status::Failure; } + if (profiling::ProfilingService::Instance().IsProfilingEnabled()) + { + profiling::ProfilingService::Instance().IncrementCounterValue(armnn::profiling::NETWORK_UNLOADS); + } } for (auto&& context : m_BackendContexts) |