IVGCVSW-5980 JSON profiling output
* Add new ProfilingDetails class to construct operator details string
* Add new macro which helps append layer details to ostream
* Add ProfilingEnabled to NetworkProperties so that profiling can be
realised when loading the network
* Add further optional info to WorkloadInfo specific to convolutions
* Generalise some JsonPrinter functions into JsonUtils for reusability
* Remove explicit enabling of profiling within InferenceModel as it is
done when loading network
* Add ProfilingDetails macros to ConvolutionWorkloads for validation
Signed-off-by: Keith Davis <keith.davis@arm.com>
Change-Id: Ie84bc7dc667e72e6bcb635544f9ead7af1765690
diff --git a/include/armnn/IRuntime.hpp b/include/armnn/IRuntime.hpp
index fcb8c05..1bae943 100644
--- a/include/armnn/IRuntime.hpp
+++ b/include/armnn/IRuntime.hpp
@@ -33,44 +33,52 @@
ARMNN_DEPRECATED_MSG("Please use INetworkProperties constructor with MemorySource argument")
INetworkProperties(bool importEnabled = false,
bool exportEnabled = false,
- bool asyncEnabled = false)
- : m_ImportEnabled(importEnabled)
- , m_ExportEnabled(exportEnabled)
- , m_AsyncEnabled(asyncEnabled)
- , m_InputSource(m_ImportEnabled ? MemorySource::Malloc : MemorySource::Undefined)
- , m_OutputSource(m_ExportEnabled ? MemorySource::Malloc : MemorySource::Undefined)
+ bool asyncEnabled = false,
+ bool profilingEnabled = false)
+ : m_ImportEnabled(importEnabled),
+ m_ExportEnabled(exportEnabled),
+ m_AsyncEnabled(asyncEnabled),
+ m_ProfilingEnabled(profilingEnabled),
+ 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,
- size_t numThreads)
- : m_ImportEnabled(m_InputSource != MemorySource::Undefined)
- , m_ExportEnabled(m_OutputSource != MemorySource::Undefined)
- , m_AsyncEnabled(asyncEnabled)
- , m_InputSource(m_InputSource)
- , m_OutputSource(m_OutputSource)
+ size_t numThreads,
+ bool profilingEnabled = false)
+ : m_ImportEnabled(m_InputSource != MemorySource::Undefined),
+ m_ExportEnabled(m_OutputSource != MemorySource::Undefined),
+ m_AsyncEnabled(asyncEnabled),
+ m_ProfilingEnabled(profilingEnabled),
+ m_InputSource(m_InputSource),
+ m_OutputSource(m_OutputSource)
{
armnn::IgnoreUnused(numThreads);
}
INetworkProperties(bool asyncEnabled,
MemorySource m_InputSource,
- MemorySource m_OutputSource)
- : m_ImportEnabled(m_InputSource != MemorySource::Undefined)
- , m_ExportEnabled(m_OutputSource != MemorySource::Undefined)
- , m_AsyncEnabled(asyncEnabled)
- , m_InputSource(m_InputSource)
- , m_OutputSource(m_OutputSource)
- {}
+ MemorySource m_OutputSource,
+ bool profilingEnabled = false)
+ : m_ImportEnabled(m_InputSource != MemorySource::Undefined),
+ m_ExportEnabled(m_OutputSource != MemorySource::Undefined),
+ m_AsyncEnabled(asyncEnabled),
+ m_ProfilingEnabled(profilingEnabled),
+ m_InputSource(m_InputSource),
+ m_OutputSource(m_OutputSource)
+ {}
/// Deprecated and will be removed in future release.
const bool m_ImportEnabled;
/// Deprecated and will be removed in future release.
const bool m_ExportEnabled;
- const bool m_AsyncEnabled;
+ const bool m_AsyncEnabled;
+
+ const bool m_ProfilingEnabled;
const MemorySource m_InputSource;
const MemorySource m_OutputSource;