blob: c5a2378659e5bd8e87f74c6ead8fab6d52259ca9 [file] [log] [blame]
telsoa01c577f2c2018-08-31 09:22:23 +01001//
Teresa Charlin588cbdf2022-01-19 15:55:37 +00002// Copyright © 2017 Arm Ltd and Contributors. All rights reserved.
David Beckecb56cd2018-09-05 12:52:57 +01003// SPDX-License-Identifier: MIT
telsoa01c577f2c2018-08-31 09:22:23 +01004//
5
6#pragma once
7
Matthew Bentham34336f92023-04-27 12:13:50 +00008#include <arm_compute/runtime/NEON/functions/NECast.h>
Colm Donelan0c479742021-12-10 12:43:54 +00009#include <armnn/backends/Workload.hpp>
10#include <armnn/backends/WorkloadData.hpp>
Matthew Bentham34336f92023-04-27 12:13:50 +000011#include <memory>
Aron Virginas-Tarc9cc8042018-11-01 16:15:57 +000012#include <neon/workloads/NeonWorkloadUtils.hpp>
telsoa01c577f2c2018-08-31 09:22:23 +010013
Matthew Bentham34336f92023-04-27 12:13:50 +000014
telsoa01c577f2c2018-08-31 09:22:23 +010015namespace armnn
16{
17
Matthew Bentham34336f92023-04-27 12:13:50 +000018arm_compute::Status NeonConvertFp16ToFp32WorkloadValidate(const TensorInfo& input, const TensorInfo& output);
19
telsoa01c577f2c2018-08-31 09:22:23 +010020class NeonConvertFp16ToFp32Workload : public Float16ToFloat32Workload<ConvertFp16ToFp32QueueDescriptor>
21{
22public:
23 NeonConvertFp16ToFp32Workload(const ConvertFp16ToFp32QueueDescriptor& descriptor, const WorkloadInfo& info);
24 virtual void Execute() const override;
David Monahanec819992022-02-10 14:47:13 +000025 // Replace input tensor handle with the given TensorHandle
26 void ReplaceInputTensorHandle(ITensorHandle* tensorHandle, unsigned int slot) override;
telsoa01c577f2c2018-08-31 09:22:23 +010027
David Monahanec819992022-02-10 14:47:13 +000028 // Replace output tensor handle with the given TensorHandle
29 void ReplaceOutputTensorHandle(ITensorHandle* tensorHandle, unsigned int slot) override;
telsoa01c577f2c2018-08-31 09:22:23 +010030private:
31 using TensorHandlePair = std::pair<const ITensorHandle*, ITensorHandle*>;
32 std::vector<TensorHandlePair> m_TensorHandlePairs;
David Monahanec819992022-02-10 14:47:13 +000033 virtual void Reconfigure();
Matthew Bentham34336f92023-04-27 12:13:50 +000034 mutable std::unique_ptr<arm_compute::NECast> m_Cast;
telsoa01c577f2c2018-08-31 09:22:23 +010035};
36
37} //namespace armnn