From f487486c843a38fced90229923433d09f99fc2e5 Mon Sep 17 00:00:00 2001 From: Keith Davis Date: Mon, 9 Aug 2021 16:49:18 +0100 Subject: IVGCVSW-6292 Allow profiling details to be switched off during profiling * Add switch for network details during profiling Signed-off-by: Keith Davis Change-Id: I8bd49fd58f0e0255598106e9ab36806ee78391d6 --- include/armnn/IProfiler.hpp | 4 ++++ include/armnn/IRuntime.hpp | 32 +++++++++++++++++++------------- 2 files changed, 23 insertions(+), 13 deletions(-) (limited to 'include/armnn') diff --git a/include/armnn/IProfiler.hpp b/include/armnn/IProfiler.hpp index 5ce42017d9..5fbb67000a 100644 --- a/include/armnn/IProfiler.hpp +++ b/include/armnn/IProfiler.hpp @@ -39,6 +39,10 @@ public: /// @param [out] outStream The stream where to write the profiling results to. void Print(std::ostream& outStream) const; + /// Print out details of each layer within the network that possesses a descriptor. + /// Also outputs tensor info. + void EnableNetworkDetailsToStdOut(); + ~IProfiler(); IProfiler(); diff --git a/include/armnn/IRuntime.hpp b/include/armnn/IRuntime.hpp index 1bae94374e..8c269dee49 100644 --- a/include/armnn/IRuntime.hpp +++ b/include/armnn/IRuntime.hpp @@ -39,36 +39,40 @@ struct INetworkProperties m_ExportEnabled(exportEnabled), m_AsyncEnabled(asyncEnabled), m_ProfilingEnabled(profilingEnabled), + m_OutputNetworkDetails(false), m_InputSource(m_ImportEnabled ? MemorySource::Malloc : MemorySource::Undefined), m_OutputSource(m_ExportEnabled ? MemorySource::Malloc : MemorySource::Undefined) {} ARMNN_DEPRECATED_MSG("Please use INetworkProperties constructor without numThreads argument") INetworkProperties(bool asyncEnabled, - MemorySource m_InputSource, - MemorySource m_OutputSource, + MemorySource inputSource, + MemorySource outputSource, size_t numThreads, bool profilingEnabled = false) - : m_ImportEnabled(m_InputSource != MemorySource::Undefined), - m_ExportEnabled(m_OutputSource != MemorySource::Undefined), + : m_ImportEnabled(inputSource != MemorySource::Undefined), + m_ExportEnabled(outputSource != MemorySource::Undefined), m_AsyncEnabled(asyncEnabled), m_ProfilingEnabled(profilingEnabled), - m_InputSource(m_InputSource), - m_OutputSource(m_OutputSource) + m_OutputNetworkDetails(false), + m_InputSource(inputSource), + m_OutputSource(outputSource) { armnn::IgnoreUnused(numThreads); } INetworkProperties(bool asyncEnabled, - MemorySource m_InputSource, - MemorySource m_OutputSource, - bool profilingEnabled = false) - : m_ImportEnabled(m_InputSource != MemorySource::Undefined), - m_ExportEnabled(m_OutputSource != MemorySource::Undefined), + MemorySource inputSource, + MemorySource outputSource, + bool profilingEnabled = false, + bool outputDetails = false) + : m_ImportEnabled(inputSource != MemorySource::Undefined), + m_ExportEnabled(outputSource != MemorySource::Undefined), m_AsyncEnabled(asyncEnabled), m_ProfilingEnabled(profilingEnabled), - m_InputSource(m_InputSource), - m_OutputSource(m_OutputSource) + m_OutputNetworkDetails(outputDetails), + m_InputSource(inputSource), + m_OutputSource(outputSource) {} /// Deprecated and will be removed in future release. @@ -80,6 +84,8 @@ struct INetworkProperties const bool m_ProfilingEnabled; + const bool m_OutputNetworkDetails; + const MemorySource m_InputSource; const MemorySource m_OutputSource; -- cgit v1.2.1