diff options
author | Nikhil Raj Arm <nikhil.raj@arm.com> | 2022-07-05 09:29:18 +0000 |
---|---|---|
committer | Nikhil Raj <nikhil.raj@arm.com> | 2022-07-08 15:21:03 +0100 |
commit | f4ccb1f6339a1e9ed573f188e7f14353167b5749 (patch) | |
tree | bb53a449cd42ed919022bd52b9e369a28d5a14d4 /tests/InferenceModel.hpp | |
parent | fd33a698ee3c588aa4064b70b7781ab25ff76f66 (diff) | |
download | armnn-f4ccb1f6339a1e9ed573f188e7f14353167b5749.tar.gz |
Revert "IVGCVSW-6650 Refactor ExecuteNetwork"
This reverts commit 615e06f54a4c4139e81e289991ba4084aa2f69d3.
Reason for revert: <Breaking nightlies and tests>
Change-Id: I06a4a0119463188a653bb749033f78514645bd0c
Diffstat (limited to 'tests/InferenceModel.hpp')
-rw-r--r-- | tests/InferenceModel.hpp | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/tests/InferenceModel.hpp b/tests/InferenceModel.hpp index 268f60301c..93716e1a6f 100644 --- a/tests/InferenceModel.hpp +++ b/tests/InferenceModel.hpp @@ -1,5 +1,5 @@ // -// Copyright © 2022 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2017 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -15,7 +15,6 @@ #include <armnn/utility/NumericCast.hpp> #include <armnnUtils/TContainer.hpp> -#include "NetworkExecutionUtils/NetworkExecutionUtils.hpp" #include <common/include/ProfilingGuid.hpp> @@ -47,6 +46,40 @@ #include <vector> #include <type_traits> +namespace +{ + +inline bool CheckRequestedBackendsAreValid(const std::vector<armnn::BackendId>& backendIds, + armnn::Optional<std::string&> invalidBackendIds = armnn::EmptyOptional()) +{ + if (backendIds.empty()) + { + return false; + } + + armnn::BackendIdSet validBackendIds = armnn::BackendRegistryInstance().GetBackendIds(); + + bool allValid = true; + for (const auto& backendId : backendIds) + { + if (std::find(validBackendIds.begin(), validBackendIds.end(), backendId) == validBackendIds.end()) + { + allValid = false; + if (invalidBackendIds) + { + if (!invalidBackendIds.value().empty()) + { + invalidBackendIds.value() += ", "; + } + invalidBackendIds.value() += backendId; + } + } + } + return allValid; +} + +} // anonymous namespace + namespace InferenceModelInternal { using BindingPointInfo = armnn::BindingPointInfo; |