aboutsummaryrefslogtreecommitdiff
path: root/src/armnn
diff options
context:
space:
mode:
Diffstat (limited to 'src/armnn')
-rw-r--r--src/armnn/LoadedNetwork.cpp2
-rw-r--r--src/armnn/Profiling.cpp12
-rw-r--r--src/armnn/Profiling.hpp4
3 files changed, 17 insertions, 1 deletions
diff --git a/src/armnn/LoadedNetwork.cpp b/src/armnn/LoadedNetwork.cpp
index c8dbcaaeb5..70b5f4e89b 100644
--- a/src/armnn/LoadedNetwork.cpp
+++ b/src/armnn/LoadedNetwork.cpp
@@ -127,6 +127,8 @@ LoadedNetwork::LoadedNetwork(std::unique_ptr<IOptimizedNetwork> net,
m_Profiler->EnableProfiling(networkProperties.m_ProfilingEnabled);
+ if (networkProperties.m_OutputNetworkDetails) m_Profiler->EnableNetworkDetailsToStdOut();
+
Graph& order = m_OptimizedNetwork->pOptimizedNetworkImpl->GetGraph().TopologicalSort();
//First create tensor handlers, backends and workload factories.
//Handlers are created before workloads are.
diff --git a/src/armnn/Profiling.cpp b/src/armnn/Profiling.cpp
index 509e9dec08..b9afc8665a 100644
--- a/src/armnn/Profiling.cpp
+++ b/src/armnn/Profiling.cpp
@@ -196,6 +196,11 @@ void ProfilerImpl::EnableProfiling(bool enableProfiling)
m_ProfilingEnabled = enableProfiling;
}
+void ProfilerImpl::EnableNetworkDetailsToStdOut()
+{
+ m_EnableDetailsToStdOut = true;
+}
+
Event* ProfilerImpl::BeginEvent(armnn::IProfiler* profiler,
const BackendId& backendId,
const std::string& label,
@@ -378,7 +383,7 @@ void ProfilerImpl::Print(std::ostream& outStream) const
printer.PrintHeader();
printer.PrintArmNNHeader();
- if (m_ProfilingDetails.get()->DetailsExist())
+ if (m_ProfilingDetails.get()->DetailsExist() && m_EnableDetailsToStdOut)
{
JsonChildObject detailsObject{ "layer_details" };
ConfigureDetailsObject(detailsObject, m_ProfilingDetails.get()->GetProfilingDetails());
@@ -539,6 +544,11 @@ void IProfiler::EnableProfiling(bool enableProfiling)
pProfilerImpl->EnableProfiling(enableProfiling);
}
+void IProfiler::EnableNetworkDetailsToStdOut()
+{
+ pProfilerImpl->EnableNetworkDetailsToStdOut();
+}
+
bool IProfiler::IsProfilingEnabled()
{
return pProfilerImpl->IsProfilingEnabled();
diff --git a/src/armnn/Profiling.hpp b/src/armnn/Profiling.hpp
index a336a0ee2a..372b489abf 100644
--- a/src/armnn/Profiling.hpp
+++ b/src/armnn/Profiling.hpp
@@ -59,6 +59,9 @@ public:
// Checks if profiling is enabled.
bool IsProfilingEnabled();
+ // Enables outputting the layer descriptors and infos to stdout
+ void EnableNetworkDetailsToStdOut();
+
// Increments the event tag, allowing grouping of events in a user-defined manner (e.g. per inference).
void UpdateEventTag();
@@ -99,6 +102,7 @@ public:
std::vector<EventPtr> m_EventSequence;
DescPtr m_ProfilingDetails = std::make_unique<ProfilingDetails>();
bool m_ProfilingEnabled;
+ bool m_EnableDetailsToStdOut;
};
// Singleton profiler manager.