From 98b0dcb7f285f0009aee52cf526e4bfacd558d6d Mon Sep 17 00:00:00 2001 From: Teresa Charlin Date: Tue, 18 Jan 2022 22:09:29 +0000 Subject: 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 Change-Id: I985e34b93a96405735402a6d3b947957afbe2857 --- src/backends/neon/workloads/NeonBaseWorkload.hpp | 40 ++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/backends/neon/workloads/NeonBaseWorkload.hpp (limited to 'src/backends/neon/workloads/NeonBaseWorkload.hpp') diff --git a/src/backends/neon/workloads/NeonBaseWorkload.hpp b/src/backends/neon/workloads/NeonBaseWorkload.hpp new file mode 100644 index 0000000000..a92f35a173 --- /dev/null +++ b/src/backends/neon/workloads/NeonBaseWorkload.hpp @@ -0,0 +1,40 @@ +// +// Copyright © 2022 Arm Ltd and Contributors. All rights reserved. +// SPDX-License-Identifier: MIT +// + +#pragma once + +#include + +namespace armnn +{ +template +class NeonBaseWorkload : public BaseWorkload +{ +public: + NeonBaseWorkload(const QueueDescriptor& descriptor, const WorkloadInfo& info) + : BaseWorkload(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 -- cgit v1.2.1