From 4914d0c1f4cbb01fe276a7093af4cff13270b74a Mon Sep 17 00:00:00 2001 From: Keith Davis Date: Wed, 18 Aug 2021 17:14:05 +0100 Subject: IVGCVSW-6249 Add ProfilingDetails Macros to all workloads in Ref, Neon, CL * Add functionality to only output network details in ExNet Signed-off-by: Keith Davis Change-Id: I0c45e67193f308ce7b86f1bb1a918a266fefba2e --- tests/InferenceModel.hpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'tests/InferenceModel.hpp') diff --git a/tests/InferenceModel.hpp b/tests/InferenceModel.hpp index 1db287f453..b982df396d 100644 --- a/tests/InferenceModel.hpp +++ b/tests/InferenceModel.hpp @@ -101,6 +101,7 @@ struct Params bool m_EnableFastMath; bool m_SaveCachedNetwork; bool m_OutputDetailsToStdOut; + bool m_OutputDetailsOnlyToStdOut; std::string m_CachedNetworkFilePath; unsigned int m_NumberOfThreads; std::string m_MLGOTuningFilePath; @@ -121,6 +122,7 @@ struct Params , m_EnableFastMath(false) , m_SaveCachedNetwork(false) , m_OutputDetailsToStdOut(false) + , m_OutputDetailsOnlyToStdOut(false) , m_CachedNetworkFilePath("") , m_NumberOfThreads(0) , m_MLGOTuningFilePath("") @@ -406,7 +408,8 @@ public: bool enableProfiling, const std::string& dynamicBackendsPath, const std::shared_ptr& runtime = nullptr) - : m_EnableProfiling(enableProfiling) + : m_EnableProfiling(enableProfiling), + m_ProfilingDetailsMethod(armnn::ProfilingDetailsMethod::Undefined) , m_DynamicBackendsPath(dynamicBackendsPath) { if (runtime) @@ -421,6 +424,12 @@ public: m_Runtime = armnn::IRuntime::Create(options); } + // Configure the Profiler if the the profiling details are opted for + if (params.m_OutputDetailsOnlyToStdOut) + m_ProfilingDetailsMethod = armnn::ProfilingDetailsMethod::DetailsOnly; + else if (params.m_OutputDetailsToStdOut) + m_ProfilingDetailsMethod = armnn::ProfilingDetailsMethod::DetailsWithEvents; + std::string invalidBackends; if (!CheckRequestedBackendsAreValid(params.m_ComputeDevices, armnn::Optional(invalidBackends))) { @@ -492,7 +501,7 @@ public: armnn::MemorySource::Undefined, armnn::MemorySource::Undefined, enableProfiling, - params.m_OutputDetailsToStdOut); + m_ProfilingDetailsMethod); std::string errorMessage; ret = m_Runtime->LoadNetwork(m_NetworkIdentifier, std::move(optNet), errorMessage, networkProperties); @@ -744,6 +753,7 @@ private: std::vector m_InputBindings; std::vector m_OutputBindings; bool m_EnableProfiling; + armnn::ProfilingDetailsMethod m_ProfilingDetailsMethod; std::string m_DynamicBackendsPath; template -- cgit v1.2.1