aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancis Murtagh <francis.murtagh@arm.com>2018-08-24 15:44:53 +0100
committerMatthew Bentham <matthew.bentham@arm.com>2018-09-18 12:39:55 +0100
commit18c9af7c7062a17a7eca8c58d1260896d165bc0a (patch)
tree8a331b401ad687e417e00f0dad34f513fbcb8bcd
parent205bb9907cbe74b696a6ef77a090206c1626c1f3 (diff)
downloadandroid-nn-driver-18c9af7c7062a17a7eca8c58d1260896d165bc0a.tar.gz
IVGCVSW-1513 - added utility method to android-nn-driver to print JSON profiling output to a file
If profiling enabled and dump directory specified, re-test needed to ensure flags are used correctly * Minor formatting changes. * Added check for runtime null pointer. Change-Id: I1e7e433a958c16c7d9b59a484b18a7902c1ad8ad
-rw-r--r--ArmnnPreparedModel.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/ArmnnPreparedModel.cpp b/ArmnnPreparedModel.cpp
index d338fdc8..1395377e 100644
--- a/ArmnnPreparedModel.cpp
+++ b/ArmnnPreparedModel.cpp
@@ -227,6 +227,11 @@ void ArmnnPreparedModel::ExecuteGraph(std::shared_ptr<std::vector<::android::nn:
{
ALOGV("ArmnnPreparedModel::ExecuteGraph(...)");
+ if (m_GpuProfilingEnabled)
+ {
+ m_Runtime->GetProfiler(m_NetworkId)->EnableProfiling(true);
+ }
+
DumpTensorsIfRequired("Input", *pInputTensors);
// run it
@@ -243,6 +248,11 @@ void ArmnnPreparedModel::ExecuteGraph(std::shared_ptr<std::vector<::android::nn:
DumpTensorsIfRequired("Output", *pOutputTensors);
+ if (m_GpuProfilingEnabled && !m_RequestInputsAndOutputsDumpDir.empty())
+ {
+ DumpJsonProfiling(m_RequestInputsAndOutputsDumpDir, m_Runtime, m_NetworkId);
+ }
+
// Commit output buffers.
// Note that we update *all* pools, even if they aren't actually used as outputs -
// this is simpler and is what the CpuExecutor does.