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 /tests/ExecuteNetwork/ArmNNExecutor.hpp | |
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 'tests/ExecuteNetwork/ArmNNExecutor.hpp')
-rw-r--r-- | tests/ExecuteNetwork/ArmNNExecutor.hpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/ExecuteNetwork/ArmNNExecutor.hpp b/tests/ExecuteNetwork/ArmNNExecutor.hpp index c4adc9e120..b0b29deffd 100644 --- a/tests/ExecuteNetwork/ArmNNExecutor.hpp +++ b/tests/ExecuteNetwork/ArmNNExecutor.hpp @@ -1,5 +1,5 @@ // -// Copyright © 2022 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2022-2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -45,6 +45,16 @@ public: private: + /** + * Returns a pointer to the armnn::IRuntime* this will be shared by all ArmNNExecutors. + */ + armnn::IRuntime* GetRuntime(const armnn::IRuntime::CreationOptions& options) + { + static armnn::IRuntimePtr instance = armnn::IRuntime::Create(options); + // Instantiated on first use. + return instance.get(); + } + struct IParser; struct IOInfo; struct IOStorage; @@ -101,7 +111,7 @@ private: std::vector<armnn::OutputTensors> m_OutputTensorsVec; std::vector<std::vector<unsigned int>> m_ImportedInputIds; std::vector<std::vector<unsigned int>> m_ImportedOutputIds; - std::shared_ptr<armnn::IRuntime> m_Runtime; + armnn::IRuntime* m_Runtime; armnn::NetworkId m_NetworkId; ExecuteNetworkParams m_Params; |