aboutsummaryrefslogtreecommitdiff
path: root/delegate/include
diff options
context:
space:
mode:
authorMike Kelly <mike.kelly@arm.com>2023-01-20 15:51:05 +0000
committermike.kelly <mike.kelly@arm.com>2023-01-24 14:46:18 +0000
commit5446a4d6d02002515fc58fafe33d74ae6dca5787 (patch)
treedb731d6a74c4603c43c95214370c82c816d274ee /delegate/include
parent2542a267dc3dfe2b9148b3944977a6864ef3c558 (diff)
downloadarmnn-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/include')
-rw-r--r--delegate/include/Version.hpp2
-rw-r--r--delegate/include/armnn_delegate.hpp14
2 files changed, 13 insertions, 3 deletions
diff --git a/delegate/include/Version.hpp b/delegate/include/Version.hpp
index 36d8fb54af..5550278414 100644
--- a/delegate/include/Version.hpp
+++ b/delegate/include/Version.hpp
@@ -13,7 +13,7 @@ namespace armnnDelegate
#define STRINGIFY_MACRO(s) #s
// ArmNN Delegate version components
-#define DELEGATE_MAJOR_VERSION 27
+#define DELEGATE_MAJOR_VERSION 28
#define DELEGATE_MINOR_VERSION 0
#define DELEGATE_PATCH_VERSION 0
diff --git a/delegate/include/armnn_delegate.hpp b/delegate/include/armnn_delegate.hpp
index 79ab4bf79c..159d590423 100644
--- a/delegate/include/armnn_delegate.hpp
+++ b/delegate/include/armnn_delegate.hpp
@@ -1,5 +1,5 @@
//
-// Copyright © 2020 Arm Ltd and Contributors. All rights reserved.
+// Copyright © 2020-2023 Arm Ltd and Contributors. All rights reserved.
// SPDX-License-Identifier: MIT
//
@@ -64,6 +64,16 @@ public:
static const std::string GetVersion();
private:
+ /**
+ * Returns a pointer to the armnn::IRuntime* this will be shared by all armnn_delegates.
+ */
+ armnn::IRuntime* GetRuntime(const armnn::IRuntime::CreationOptions& options)
+ {
+ static armnn::IRuntimePtr instance = armnn::IRuntime::Create(options);
+ // Instantiated on first use.
+ return instance.get();
+ }
+
TfLiteDelegate m_Delegate = {
reinterpret_cast<void*>(this), // .data_
DoPrepare, // .Prepare
@@ -74,7 +84,7 @@ private:
};
/// ArmNN Runtime pointer
- armnn::IRuntimePtr m_Runtime;
+ armnn::IRuntime* m_Runtime;
/// ArmNN Delegate Options
armnnDelegate::DelegateOptions m_Options;
};