From 1a7f033768acb27da11503bd29abb468d2e77f9e Mon Sep 17 00:00:00 2001 From: Nikhil Raj Arm Date: Tue, 5 Jul 2022 09:29:18 +0000 Subject: Revert "IVGCVSW-6650 Refactor ExecuteNetwork" This reverts commit 615e06f54a4c4139e81e289991ba4084aa2f69d3. Reason for revert: Change-Id: I06a4a0119463188a653bb749033f78514645bd0c --- tests/InferenceModel.hpp | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) (limited to 'tests/InferenceModel.hpp') 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 #include -#include "NetworkExecutionUtils/NetworkExecutionUtils.hpp" #include @@ -47,6 +46,40 @@ #include #include +namespace +{ + +inline bool CheckRequestedBackendsAreValid(const std::vector& backendIds, + armnn::Optional 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; -- cgit v1.2.1