aboutsummaryrefslogtreecommitdiff
path: root/src/armnn/Profiling.cpp
diff options
context:
space:
mode:
authorKeith Davis <keith.davis@arm.com>2021-07-20 11:25:22 +0100
committerKeith Davis <keith.davis@arm.com>2021-08-04 11:49:16 +0100
commit554fa09a0f3d6c9c572634c9d2de9bfb6c3218b0 (patch)
tree1820a2cadcc1f34667199acff2d044e5d2083ea2 /src/armnn/Profiling.cpp
parent96fd98c28441618fbdf9376fe46a368ef06b19e1 (diff)
downloadarmnn-554fa09a0f3d6c9c572634c9d2de9bfb6c3218b0.tar.gz
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
Diffstat (limited to 'src/armnn/Profiling.cpp')
-rw-r--r--src/armnn/Profiling.cpp23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/armnn/Profiling.cpp b/src/armnn/Profiling.cpp
index d62c18a9a8..171d22bd0f 100644
--- a/src/armnn/Profiling.cpp
+++ b/src/armnn/Profiling.cpp
@@ -281,6 +281,13 @@ void ProfilerImpl::PopulateDescendants(std::map<const Event*, std::vector<const
}
}
+void ConfigureDetailsObject(JsonChildObject& detailsObject,
+ std::string layerDetailsStr)
+{
+ detailsObject.SetType(JsonObjectType::ExecObjectDesc);
+ detailsObject.SetAndParseDetails(layerDetailsStr);
+
+}
void ExtractJsonObjects(unsigned int inferenceIndex,
const Event* parentEvent,
@@ -347,7 +354,6 @@ void ProfilerImpl::Print(std::ostream& outStream) const
PopulateDescendants(descendantsMap);
JsonChildObject inferenceObject{"inference_measurements"};
- JsonChildObject layerObject{"layer_measurements"};
std::vector<JsonChildObject> workloadObjects;
std::map<unsigned int, std::vector<JsonChildObject>> workloadToKernelObjects;
@@ -360,6 +366,15 @@ void ProfilerImpl::Print(std::ostream& outStream) const
printer.PrintHeader();
printer.PrintArmNNHeader();
+ if (m_ProfilingDetails.get()->DetailsExist())
+ {
+ JsonChildObject detailsObject{"layer_details"};
+ ConfigureDetailsObject(detailsObject, m_ProfilingDetails.get()->GetProfilingDetails());
+
+ size_t id=0;
+ printer.PrintJsonChildObject(detailsObject, id);
+ }
+
// print inference object, also prints child layer and kernel measurements
size_t id=0;
printer.PrintJsonChildObject(inferenceObject, id);
@@ -525,10 +540,10 @@ void IProfiler::Print(std::ostream& outStream) const
}
Event* IProfiler::BeginEvent(const BackendId& backendId,
- const std::string& label,
- std::vector<InstrumentPtr>&& instruments)
+ const std::string& label,
+ std::vector<InstrumentPtr>&& instruments)
{
- return pProfilerImpl->BeginEvent(this, backendId, label, std::move(instruments));
+ return pProfilerImpl->BeginEvent(this, backendId, label, std::move(instruments));
}
IProfiler::~IProfiler() = default;