diff options
author | Matthew Sloyan <matthew.sloyan@arm.com> | 2022-06-30 17:13:04 +0100 |
---|---|---|
committer | Nikhil Raj <nikhil.raj@arm.com> | 2022-07-27 15:52:10 +0100 |
commit | 2d213a759e68f753ef4696e02a8535f7edfe421d (patch) | |
tree | f4003d0a60e907937e04d96fc434c0bfac596f86 /include/armnn/backends/IBackendInternal.hpp | |
parent | 28aa6691accfd78c5eb5c4356316220d0e82ddef (diff) | |
download | armnn-2d213a759e68f753ef4696e02a8535f7edfe421d.tar.gz |
IVGCVSW-6620 Update the async api to use ExecutionData
* ExecutionData holds a void* which can be assigned to data required
for execution in a backend. WorkingMemDescriptors are used in the Ref
backend which hold TensorHandles for inputs and outputs.
* Updated ExecuteAsync functions to take ExecutionData.
* Added CreateExecutionData and UpdateExectutionData to IBackendInternal.
* Streamlined experimental IWorkingMemHandle API by removing map related
function and unused m_workingMemDescriptorMap from WorkingMemHandle.
Signed-off-by: Matthew Sloyan <matthew.sloyan@arm.com>
Change-Id: I54b0aab12872011743a141eb42dae200227769af
Diffstat (limited to 'include/armnn/backends/IBackendInternal.hpp')
-rw-r--r-- | include/armnn/backends/IBackendInternal.hpp | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/include/armnn/backends/IBackendInternal.hpp b/include/armnn/backends/IBackendInternal.hpp index e393a7e1c5..a18adbac5a 100644 --- a/include/armnn/backends/IBackendInternal.hpp +++ b/include/armnn/backends/IBackendInternal.hpp @@ -1,5 +1,5 @@ // -// Copyright © 2017 Arm Ltd. All rights reserved. +// Copyright © 2022 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -9,7 +9,9 @@ #include <armnn/IRuntime.hpp> #include <armnn/Deprecated.hpp> +#include <ExecutionData.hpp> #include <ISubgraphViewConverter.hpp> +#include <WorkingMemDescriptor.hpp> #include <armnn/backends/IBackendContext.hpp> #include <armnn/backends/IMemoryManager.hpp> @@ -205,6 +207,27 @@ public: /// /// \return - Returns 0 if backend does not support caching otherwise number of files cached virtual unsigned int GetNumberOfCacheFiles() const { return 0; } + + /// Returns ExecutionData for the backend + /// + /// \param workingMemDescriptor - Vectors of input and output TensorHandles for a layer + /// \return - Returns backend specific ExecutionData generated for a layer + virtual ExecutionData CreateExecutionData(WorkingMemDescriptor& workingMemDescriptor) const + { + IgnoreUnused(workingMemDescriptor); + throw armnn::Exception("CreateExecutionData: Function has not been implemented in backend."); + }; + + /// Update the ExecutionData for a layer. It is used to swap in pre-imported tensor handles + /// + /// \param executionData - Backend specific ExecutionData generated for a layer + /// \param workingMemDescriptor - Vectors of input and output TensorHandles for a layer + virtual void UpdateExecutionData(ExecutionData& executionData, WorkingMemDescriptor& workingMemDescriptor) const + { + IgnoreUnused(executionData); + IgnoreUnused(workingMemDescriptor); + throw armnn::Exception("UpdateExecutionData: Function has not been implemented in backend."); + }; }; using IBackendInternalUniquePtr = std::unique_ptr<IBackendInternal>; |