aboutsummaryrefslogtreecommitdiff
path: root/src/armnn
diff options
context:
space:
mode:
authorKeith Davis <keith.davis@arm.com>2021-08-18 17:14:05 +0100
committerNikhil Raj Arm <nikhil.raj@arm.com>2021-08-20 09:10:22 +0000
commit4914d0c1f4cbb01fe276a7093af4cff13270b74a (patch)
treece6c4364bb596803148833af535215aa6ab6de90 /src/armnn
parente369dbddae66c58f4b444c4b25871c10af19ed9d (diff)
downloadarmnn-4914d0c1f4cbb01fe276a7093af4cff13270b74a.tar.gz
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 <keith.davis@arm.com> Change-Id: I0c45e67193f308ce7b86f1bb1a918a266fefba2e
Diffstat (limited to 'src/armnn')
-rw-r--r--src/armnn/LoadedNetwork.cpp2
-rw-r--r--src/armnn/Profiling.cpp25
-rw-r--r--src/armnn/Profiling.hpp5
3 files changed, 21 insertions, 11 deletions
diff --git a/src/armnn/LoadedNetwork.cpp b/src/armnn/LoadedNetwork.cpp
index 70b5f4e89b..531d43dbb5 100644
--- a/src/armnn/LoadedNetwork.cpp
+++ b/src/armnn/LoadedNetwork.cpp
@@ -127,7 +127,7 @@ LoadedNetwork::LoadedNetwork(std::unique_ptr<IOptimizedNetwork> net,
m_Profiler->EnableProfiling(networkProperties.m_ProfilingEnabled);
- if (networkProperties.m_OutputNetworkDetails) m_Profiler->EnableNetworkDetailsToStdOut();
+ m_Profiler->EnableNetworkDetailsToStdOut(networkProperties.m_OutputNetworkDetailsMethod);
Graph& order = m_OptimizedNetwork->pOptimizedNetworkImpl->GetGraph().TopologicalSort();
//First create tensor handlers, backends and workload factories.
diff --git a/src/armnn/Profiling.cpp b/src/armnn/Profiling.cpp
index 8208fd9e0e..7de602fc40 100644
--- a/src/armnn/Profiling.cpp
+++ b/src/armnn/Profiling.cpp
@@ -163,7 +163,7 @@ void ProfilerImpl::AnalyzeEventSequenceAndWriteResults(ItertType first, ItertTyp
ProfilerImpl::ProfilerImpl()
: m_ProfilingEnabled(false),
- m_EnableDetailsToStdOut(false)
+ m_DetailsToStdOutMethod(ProfilingDetailsMethod::Undefined)
{
m_EventSequence.reserve(g_ProfilingEventCountHint);
@@ -197,9 +197,9 @@ void ProfilerImpl::EnableProfiling(bool enableProfiling)
m_ProfilingEnabled = enableProfiling;
}
-void ProfilerImpl::EnableNetworkDetailsToStdOut()
+void ProfilerImpl::EnableNetworkDetailsToStdOut(ProfilingDetailsMethod details)
{
- m_EnableDetailsToStdOut = true;
+ m_DetailsToStdOutMethod = details;
}
Event* ProfilerImpl::BeginEvent(armnn::IProfiler* profiler,
@@ -384,7 +384,9 @@ void ProfilerImpl::Print(std::ostream& outStream) const
printer.PrintHeader();
printer.PrintArmNNHeader();
- if (m_ProfilingDetails.get()->DetailsExist() && m_EnableDetailsToStdOut)
+ if (m_ProfilingDetails.get()->DetailsExist() &&
+ (m_DetailsToStdOutMethod == ProfilingDetailsMethod::DetailsOnly
+ || m_DetailsToStdOutMethod == ProfilingDetailsMethod::DetailsWithEvents))
{
JsonChildObject detailsObject{ "layer_details" };
ConfigureDetailsObject(detailsObject, m_ProfilingDetails.get()->GetProfilingDetails());
@@ -395,8 +397,10 @@ void ProfilerImpl::Print(std::ostream& outStream) const
// print inference object, also prints child layer and kernel measurements
size_t id = 0;
- printer.PrintJsonChildObject(inferenceObject, id);
-
+ if (m_DetailsToStdOutMethod != ProfilingDetailsMethod::DetailsOnly)
+ {
+ printer.PrintJsonChildObject(inferenceObject, id);
+ }
// end of ArmNN
printer.PrintNewLine();
printer.PrintFooter();
@@ -409,6 +413,11 @@ void ProfilerImpl::Print(std::ostream& outStream) const
// Restores previous precision settings.
outStream.flags(oldFlags);
outStream.precision(oldPrecision);
+
+ if (m_DetailsToStdOutMethod == ProfilingDetailsMethod::DetailsOnly)
+ {
+ exit(0);
+ }
}
void ProfilerImpl::AnalyzeEventsAndWriteResults(std::ostream& outStream) const
@@ -545,9 +554,9 @@ void IProfiler::EnableProfiling(bool enableProfiling)
pProfilerImpl->EnableProfiling(enableProfiling);
}
-void IProfiler::EnableNetworkDetailsToStdOut()
+void IProfiler::EnableNetworkDetailsToStdOut(ProfilingDetailsMethod detailsMethod)
{
- pProfilerImpl->EnableNetworkDetailsToStdOut();
+ pProfilerImpl->EnableNetworkDetailsToStdOut(detailsMethod);
}
bool IProfiler::IsProfilingEnabled()
diff --git a/src/armnn/Profiling.hpp b/src/armnn/Profiling.hpp
index 372b489abf..42d7f4d638 100644
--- a/src/armnn/Profiling.hpp
+++ b/src/armnn/Profiling.hpp
@@ -60,7 +60,7 @@ public:
bool IsProfilingEnabled();
// Enables outputting the layer descriptors and infos to stdout
- void EnableNetworkDetailsToStdOut();
+ void EnableNetworkDetailsToStdOut(ProfilingDetailsMethod detailsMethod);
// Increments the event tag, allowing grouping of events in a user-defined manner (e.g. per inference).
void UpdateEventTag();
@@ -102,7 +102,8 @@ public:
std::vector<EventPtr> m_EventSequence;
DescPtr m_ProfilingDetails = std::make_unique<ProfilingDetails>();
bool m_ProfilingEnabled;
- bool m_EnableDetailsToStdOut;
+ ProfilingDetailsMethod m_DetailsToStdOutMethod;
+
};
// Singleton profiler manager.