diff options
author | Colm Donelan <colm.donelan@arm.com> | 2024-03-04 22:19:26 +0000 |
---|---|---|
committer | Colm Donelan <colm.donelan@arm.com> | 2024-03-04 22:19:26 +0000 |
commit | 253d1bb78a6ac543968129925c9a69ddb880b4dc (patch) | |
tree | d62082709676b3d8f67de17be867276afabd1567 /delegate/opaque/src/armnn_delegate.cpp | |
parent | 2ab3032ae39d129ef79115cad9084a7074606b59 (diff) | |
download | armnn-253d1bb78a6ac543968129925c9a69ddb880b4dc.tar.gz |
IVGCVSW-7572 Only print JSON profiling once per ArmnnSubgraph.
Previously the JSON profiling was printed once per delegate invoke call.
Modify that to print only once per ArmnnSubgraph. Data from multiple
inferences is grouped together.
Signed-off-by: Colm Donelan <colm.donelan@arm.com>
Change-Id: I1beb60eae4685c8e628dd1939f41bd649fc2a6ba
Diffstat (limited to 'delegate/opaque/src/armnn_delegate.cpp')
-rw-r--r-- | delegate/opaque/src/armnn_delegate.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/delegate/opaque/src/armnn_delegate.cpp b/delegate/opaque/src/armnn_delegate.cpp index 54bdf36982..4ed0a78013 100644 --- a/delegate/opaque/src/armnn_delegate.cpp +++ b/delegate/opaque/src/armnn_delegate.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2023 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2023-2024 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -376,6 +376,16 @@ TfLiteIntArray* ArmnnOpaqueDelegate::IdentifyOperatorsToDelegate(TfLiteOpaqueCon return nodesToDelegate; } +ArmnnSubgraph::~ArmnnSubgraph() +{ + // The delegate holds its own Arm NN runtime so this is our last chance to print internal profiling data. + std::shared_ptr<armnn::IProfiler> profiler = m_Runtime->GetProfiler(m_NetworkId); + if (profiler && profiler->IsProfilingEnabled()) + { + profiler->Print(std::cout); + } +} + TfLiteStatus ArmnnSubgraph::AddInputLayer(DelegateData& delegateData, TfLiteOpaqueContext* tfLiteContext, const TfLiteIntArray* inputs, @@ -668,12 +678,6 @@ TfLiteStatus ArmnnSubgraph::Invoke(TfLiteOpaqueContext* tfLiteContext, TfLiteOpa try { auto status = m_Runtime->EnqueueWorkload(m_NetworkId, inputTensors, outputTensors); - // The delegate holds its own Arm NN runtime so this is our last chance to print internal profiling data. - std::shared_ptr<armnn::IProfiler> profiler = m_Runtime->GetProfiler(m_NetworkId); - if (profiler && profiler->IsProfilingEnabled()) - { - profiler->Print(std::cout); - } return (status == armnn::Status::Success) ? kTfLiteOk : kTfLiteError; } catch (armnn::InvalidArgumentException& ex) |