diff options
author | Mike Kelly <mike.kelly@arm.com> | 2023-01-20 15:51:05 +0000 |
---|---|---|
committer | mike.kelly <mike.kelly@arm.com> | 2023-01-24 14:46:18 +0000 |
commit | 5446a4d6d02002515fc58fafe33d74ae6dca5787 (patch) | |
tree | db731d6a74c4603c43c95214370c82c816d274ee /delegate/src/armnn_delegate.cpp | |
parent | 2542a267dc3dfe2b9148b3944977a6864ef3c558 (diff) | |
download | armnn-5446a4d6d02002515fc58fafe33d74ae6dca5787.tar.gz |
IVGCVSW-7297 When creating multiple Executors only the last
one works fine
* All ArmNNExecutors now share a single IRuntime.
* All armnn_delegates now share a single IRuntime.
* Increased delegate major version.
Signed-off-by: Mike Kelly <mike.kelly@arm.com>
Change-Id: I95cbdc32655ec0beb476dbb2d60f1a0209df8f04
Diffstat (limited to 'delegate/src/armnn_delegate.cpp')
-rw-r--r-- | delegate/src/armnn_delegate.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/delegate/src/armnn_delegate.cpp b/delegate/src/armnn_delegate.cpp index 1557ec92b6..b2d9c67c7b 100644 --- a/delegate/src/armnn_delegate.cpp +++ b/delegate/src/armnn_delegate.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2022-2023 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2020-2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -133,17 +133,16 @@ TfLiteStatus DoPrepare(TfLiteContext* tfLiteContext, TfLiteDelegate* tfLiteDeleg } Delegate::Delegate(armnnDelegate::DelegateOptions options) - : m_Runtime(nullptr, nullptr), - m_Options(std::move(options)) + : m_Options(std::move(options)) { // Configures logging for ARMNN if (m_Options.IsLoggingEnabled()) { armnn::ConfigureLogging(true, true, m_Options.GetLoggingSeverity()); } - // Create ArmNN Runtime - m_Runtime = armnn::IRuntime::Create(m_Options.GetRuntimeOptions()); - + // Create/Get the static ArmNN Runtime. Note that the m_Runtime will be shared by all armnn_delegate + // instances so the RuntimeOptions cannot be altered for different armnn_delegate instances. + m_Runtime = GetRuntime(m_Options.GetRuntimeOptions()); std::vector<armnn::BackendId> backends; if (m_Runtime) { @@ -463,7 +462,7 @@ ArmnnSubgraph* ArmnnSubgraph::Create(TfLiteContext* tfLiteContext, << std::fixed << armnn::GetTimeDuration(startTime).count() << " ms\n"; // Create a new SubGraph with networkId and runtime - return new ArmnnSubgraph(networkId, delegate->m_Runtime.get(), inputBindings, outputBindings); + return new ArmnnSubgraph(networkId, delegate->m_Runtime, inputBindings, outputBindings); } TfLiteStatus ArmnnSubgraph::Prepare(TfLiteContext* tfLiteContext) |