telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 1 | // |
Teresa Charlin | 588cbdf | 2022-01-19 15:55:37 +0000 | [diff] [blame] | 2 | // Copyright © 2017 Arm Ltd and Contributors. All rights reserved. |
David Beck | ecb56cd | 2018-09-05 12:52:57 +0100 | [diff] [blame] | 3 | // SPDX-License-Identifier: MIT |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 4 | // |
| 5 | |
| 6 | #pragma once |
| 7 | |
Matthew Bentham | 34336f9 | 2023-04-27 12:13:50 +0000 | [diff] [blame] | 8 | #include <arm_compute/runtime/NEON/functions/NECast.h> |
Colm Donelan | 0c47974 | 2021-12-10 12:43:54 +0000 | [diff] [blame] | 9 | #include <armnn/backends/Workload.hpp> |
| 10 | #include <armnn/backends/WorkloadData.hpp> |
Matthew Bentham | 34336f9 | 2023-04-27 12:13:50 +0000 | [diff] [blame] | 11 | #include <memory> |
Aron Virginas-Tar | c9cc804 | 2018-11-01 16:15:57 +0000 | [diff] [blame] | 12 | #include <neon/workloads/NeonWorkloadUtils.hpp> |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 13 | |
Matthew Bentham | 34336f9 | 2023-04-27 12:13:50 +0000 | [diff] [blame] | 14 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 15 | namespace armnn |
| 16 | { |
| 17 | |
Matthew Bentham | 34336f9 | 2023-04-27 12:13:50 +0000 | [diff] [blame] | 18 | arm_compute::Status NeonConvertFp16ToFp32WorkloadValidate(const TensorInfo& input, const TensorInfo& output); |
| 19 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 20 | class NeonConvertFp16ToFp32Workload : public Float16ToFloat32Workload<ConvertFp16ToFp32QueueDescriptor> |
| 21 | { |
| 22 | public: |
| 23 | NeonConvertFp16ToFp32Workload(const ConvertFp16ToFp32QueueDescriptor& descriptor, const WorkloadInfo& info); |
| 24 | virtual void Execute() const override; |
David Monahan | ec81999 | 2022-02-10 14:47:13 +0000 | [diff] [blame] | 25 | // Replace input tensor handle with the given TensorHandle |
| 26 | void ReplaceInputTensorHandle(ITensorHandle* tensorHandle, unsigned int slot) override; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 27 | |
David Monahan | ec81999 | 2022-02-10 14:47:13 +0000 | [diff] [blame] | 28 | // Replace output tensor handle with the given TensorHandle |
| 29 | void ReplaceOutputTensorHandle(ITensorHandle* tensorHandle, unsigned int slot) override; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 30 | private: |
| 31 | using TensorHandlePair = std::pair<const ITensorHandle*, ITensorHandle*>; |
| 32 | std::vector<TensorHandlePair> m_TensorHandlePairs; |
David Monahan | ec81999 | 2022-02-10 14:47:13 +0000 | [diff] [blame] | 33 | virtual void Reconfigure(); |
Matthew Bentham | 34336f9 | 2023-04-27 12:13:50 +0000 | [diff] [blame] | 34 | mutable std::unique_ptr<arm_compute::NECast> m_Cast; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 35 | }; |
| 36 | |
| 37 | } //namespace armnn |