aboutsummaryrefslogtreecommitdiff
path: root/src/armnn/Profiling.cpp
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/Profiling.cpp
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/Profiling.cpp')
-rw-r--r--src/armnn/Profiling.cpp25
1 files changed, 17 insertions, 8 deletions
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()