diff options
author | Teresa Charlin <teresa.charlinreyes@arm.com> | 2022-01-18 22:09:29 +0000 |
---|---|---|
committer | Teresa Charlin <teresa.charlinreyes@arm.com> | 2022-01-26 14:38:27 +0000 |
commit | 98b0dcb7f285f0009aee52cf526e4bfacd558d6d (patch) | |
tree | 0490ed7bedc9774c5dcaa134534d5804e4e33763 /src/backends/cl/workloads/ClBaseWorkload.hpp | |
parent | 524a99ccf69b4bf5c8188bc9e4d89f402c374cae (diff) | |
download | armnn-98b0dcb7f285f0009aee52cf526e4bfacd558d6d.tar.gz |
IVGCVSW-6683-6684 Add ClBaseWorkload and NeonBaseWorkload
* Neon/Cl Activation workloads inherit from Cl/Neon BaseWorkload
* Unit Test for ReplaceTensorHandle functions
Signed-off-by: Teresa Charlin <teresa.charlinreyes@arm.com>
Change-Id: I985e34b93a96405735402a6d3b947957afbe2857
Diffstat (limited to 'src/backends/cl/workloads/ClBaseWorkload.hpp')
-rw-r--r-- | src/backends/cl/workloads/ClBaseWorkload.hpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/backends/cl/workloads/ClBaseWorkload.hpp b/src/backends/cl/workloads/ClBaseWorkload.hpp new file mode 100644 index 0000000000..e74fc84f4f --- /dev/null +++ b/src/backends/cl/workloads/ClBaseWorkload.hpp @@ -0,0 +1,40 @@ +// +// Copyright © 2022 Arm Ltd and Contributors. All rights reserved. +// SPDX-License-Identifier: MIT +// + +#pragma once + +#include <armnn/backends/Workload.hpp> + +namespace armnn +{ +template <typename QueueDescriptor> +class ClBaseWorkload : public BaseWorkload<QueueDescriptor> +{ +public: + ClBaseWorkload(const QueueDescriptor& descriptor, const WorkloadInfo& info) + : BaseWorkload<QueueDescriptor>(descriptor, info) + {} + + // Replace input tensor handle with the given TensorHandle and call Reconfigure() + void ReplaceInputTensorHandle(ITensorHandle* tensorHandle, unsigned int slot) override + { + this->m_Data.m_Inputs[slot] = tensorHandle; + Reconfigure(); + } + + // Replace output tensor handle with the given TensorHandle and call Reconfigure() + void ReplaceOutputTensorHandle(ITensorHandle* tensorHandle, unsigned int slot) override + { + this->m_Data.m_Outputs[slot] = tensorHandle; + Reconfigure(); + } + + // Reconfigure the workload configuration. Throw armnn::UnimplementedException by default. + virtual void Reconfigure() + { + throw armnn::UnimplementedException("Reconfigure not implemented for this workload"); + } +}; +} //namespace armnn |