diff options
author | Colm Donelan <colm.donelan@arm.com> | 2022-02-15 14:59:08 +0000 |
---|---|---|
committer | Colm Donelan <colm.donelan@arm.com> | 2022-02-15 15:05:43 +0000 |
commit | 2048b68cf7caf14e03ceaf84d841bda7bbda8c75 (patch) | |
tree | 37e8c5e102f487a67ca51c224f54cccafa527fb6 /ArmnnPreparedModel_1_2.cpp | |
parent | 0c65ddb3bdb29850b669fafb00a46cb7f67ee675 (diff) | |
download | android-nn-driver-2048b68cf7caf14e03ceaf84d841bda7bbda8c75.tar.gz |
IVGCVSW-6783 Re-ordering DumpJsonProfilingIfRequired in ArmnnPreparedModel
* In the destructor of ArmnnPreparedModel, DumpJsonProfilingIfRequired
was being called with a potentially null profiler.
Signed-off-by: Colm Donelan <colm.donelan@arm.com>
Change-Id: Id0d3a2403878fedc4e05dc498edb48d574232c71
Diffstat (limited to 'ArmnnPreparedModel_1_2.cpp')
-rw-r--r-- | ArmnnPreparedModel_1_2.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/ArmnnPreparedModel_1_2.cpp b/ArmnnPreparedModel_1_2.cpp index 29055a70..7f35e60f 100644 --- a/ArmnnPreparedModel_1_2.cpp +++ b/ArmnnPreparedModel_1_2.cpp @@ -230,6 +230,12 @@ ArmnnPreparedModel_1_2<HalVersion>::~ArmnnPreparedModel_1_2() { // Get a hold of the profiler used by this model. std::shared_ptr<armnn::IProfiler> profiler = m_Runtime->GetProfiler(m_NetworkId); + if (profiler && m_GpuProfilingEnabled) + { + // Dump the profiling info to a file if required. + DumpJsonProfilingIfRequired(m_GpuProfilingEnabled, m_RequestInputsAndOutputsDumpDir, m_NetworkId, + profiler.get()); + } // Unload the network associated with this model. m_Runtime->UnloadNetwork(m_NetworkId); @@ -239,9 +245,6 @@ ArmnnPreparedModel_1_2<HalVersion>::~ArmnnPreparedModel_1_2() { m_Threadpool->UnloadMemHandles(m_NetworkId); } - - // Dump the profiling info to a file if required. - DumpJsonProfilingIfRequired(m_GpuProfilingEnabled, m_RequestInputsAndOutputsDumpDir, m_NetworkId, profiler.get()); } template<typename HalVersion> |