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 | |
Colm Donelan | 0c47974 | 2021-12-10 12:43:54 +0000 | [diff] [blame] | 8 | #include <armnn/backends/Workload.hpp> |
Matthew Bentham | 14e4669 | 2018-09-20 15:35:30 +0100 | [diff] [blame] | 9 | |
Matthew Bentham | 9b3e738 | 2020-02-05 21:39:55 +0000 | [diff] [blame] | 10 | #include <arm_compute/runtime/CL/functions/CLDepthConvertLayer.h> |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 11 | |
Jim Flynn | 5e7335b | 2022-02-14 11:22:29 +0000 | [diff] [blame] | 12 | #include <cl/ICLTensorProxy.hpp> |
| 13 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 14 | namespace armnn |
| 15 | { |
| 16 | |
| 17 | class ClConvertFp16ToFp32Workload : public Float16ToFloat32Workload<ConvertFp16ToFp32QueueDescriptor> |
| 18 | { |
| 19 | public: |
| 20 | |
Sadik Armagan | e944475 | 2020-12-02 11:28:58 +0000 | [diff] [blame] | 21 | ClConvertFp16ToFp32Workload(const ConvertFp16ToFp32QueueDescriptor& descriptor, |
| 22 | const WorkloadInfo& info, |
| 23 | const arm_compute::CLCompileContext& clCompileContext); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 24 | virtual void Execute() const override; |
| 25 | |
David Monahan | c27d15c | 2022-02-17 11:00:09 +0000 | [diff] [blame] | 26 | bool SupportsTensorHandleReplacement() const override { return true;}; |
| 27 | |
David Monahan | ec81999 | 2022-02-10 14:47:13 +0000 | [diff] [blame] | 28 | // Replace input tensor handle with the given TensorHandle |
| 29 | void ReplaceInputTensorHandle(ITensorHandle* tensorHandle, unsigned int slot) override; |
| 30 | |
| 31 | // Replace output tensor handle with the given TensorHandle |
| 32 | void ReplaceOutputTensorHandle(ITensorHandle* tensorHandle, unsigned int slot) override; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 33 | private: |
| 34 | mutable arm_compute::CLDepthConvertLayer m_Layer; |
David Monahan | ec81999 | 2022-02-10 14:47:13 +0000 | [diff] [blame] | 35 | virtual void Reconfigure(); |
Jim Flynn | 5e7335b | 2022-02-14 11:22:29 +0000 | [diff] [blame] | 36 | |
| 37 | std::unique_ptr<ICLTensorProxy> m_InputProxy; |
| 38 | std::unique_ptr<ICLTensorProxy> m_OutputProxy; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 39 | }; |
| 40 | |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 41 | arm_compute::Status ClConvertFp16ToFp32WorkloadValidate(const TensorInfo& input, const TensorInfo& output); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 42 | |
| 43 | } //namespace armnn |