From 2b32a69f3aac5496d0a966d9740cb4854504f3d9 Mon Sep 17 00:00:00 2001 From: Cathal Corbett Date: Mon, 9 Jan 2023 12:47:48 +0000 Subject: IVGCVSW-7380 Update the GpuFsa Skeleton to build and load ACL * Reuse cl backend to be able to create ClRuntime, ClContexts etc. for the new GpuFsa backend. * Can access code defined in the experimental interface dynamic_fusion. * No BackendModelContext as model/backend options not required for now. * Any of the serializer and deserializer is emitted as context caching not required. * No ImportTensorHandle and ImportTensorHandleFactory for now. * Moved tuning and IClTensorHandle code to aclCommon as it is accessed by both cl and gpuFsa. * Small code refactor of cl backend. * Added DefaultAllocatorTests to GpuFsa backend. Signed-off-by: Cathal Corbett Change-Id: I6ae591360e9d2a783aafd06e2d7bf8e0b3e623ee --- src/armnn/Network.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/armnn') diff --git a/src/armnn/Network.cpp b/src/armnn/Network.cpp index 42388bfbd7..cda87e89c2 100644 --- a/src/armnn/Network.cpp +++ b/src/armnn/Network.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2017,2022 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2017,2022-2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -1582,6 +1582,18 @@ IOptimizedNetworkPtr Optimize(const Graph& inGraph, ProfilerManager::GetInstance().RegisterProfiler(profiler.get()); profiler->EnableProfiling(options.m_ProfilingEnabled); + // Some backends don't play well together. Check here before continuing. + { + std::set backendSet(backendPreferences.begin(), backendPreferences.end()); + // GpuFsa cannot co-exist with GpuAcc. + if (backendSet.find("GpuFsa") != backendSet.end() && + backendSet.find("GpuAcc") != backendSet.end()) + { + throw InvalidArgumentException("The backends \"GpuAcc\" and \"GpuFsa\" cannot be specified " + "for the same optimized network."); + } + } + ARMNN_SCOPED_PROFILING_EVENT(Compute::Undefined, "Optimizer"); if (backendPreferences.empty()) { -- cgit v1.2.1