ArmNN
 24.02
ClConvertFp32ToFp16Workload.hpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #pragma once
7 
9 
10 #include <arm_compute/runtime/CL/functions/CLDepthConvertLayer.h>
11 
12 #include <cl/ICLTensorProxy.hpp>
13 
14 namespace armnn
15 {
16 
17 class ClConvertFp32ToFp16Workload : public Float32ToFloat16Workload<ConvertFp32ToFp16QueueDescriptor>
18 {
19 public:
20 
22  const WorkloadInfo& info,
23  const arm_compute::CLCompileContext& clCompileContext);
24  virtual void Execute() const override;
25 
26  bool SupportsTensorHandleReplacement() const override { return true;};
27 
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;
33 private:
34  mutable arm_compute::CLDepthConvertLayer m_Layer;
35  virtual void Reconfigure();
36 
37  std::unique_ptr<ICLTensorProxy> m_InputProxy;
38  std::unique_ptr<ICLTensorProxy> m_OutputProxy;
39 };
40 
41 arm_compute::Status ClConvertFp32ToFp16WorkloadValidate(const TensorInfo& input, const TensorInfo& output);
42 
43 } //namespace armnn
armnn::ClConvertFp32ToFp16Workload::SupportsTensorHandleReplacement
bool SupportsTensorHandleReplacement() const override
Definition: ClConvertFp32ToFp16Workload.hpp:26
armnn::ClConvertFp32ToFp16Workload::ClConvertFp32ToFp16Workload
ClConvertFp32ToFp16Workload(const ConvertFp32ToFp16QueueDescriptor &descriptor, const WorkloadInfo &info, const arm_compute::CLCompileContext &clCompileContext)
Definition: ClConvertFp32ToFp16Workload.cpp:17
armnn::ClConvertFp32ToFp16Workload::Execute
virtual void Execute() const override
Definition: ClConvertFp32ToFp16Workload.cpp:38
armnn::ITensorHandle
Definition: ITensorHandle.hpp:16
armnn::ConvertFp32ToFp16QueueDescriptor
Definition: WorkloadData.hpp:457
armnn::ClConvertFp32ToFp16Workload::ReplaceInputTensorHandle
void ReplaceInputTensorHandle(ITensorHandle *tensorHandle, unsigned int slot) override
Definition: ClConvertFp32ToFp16Workload.cpp:64
armnn::WorkloadInfo
Contains information about TensorInfos of a layer.
Definition: WorkloadInfo.hpp:16
Workload.hpp
armnn::ClConvertFp32ToFp16WorkloadValidate
arm_compute::Status ClConvertFp32ToFp16WorkloadValidate(const TensorInfo &input, const TensorInfo &output)
Definition: ClConvertFp32ToFp16Workload.cpp:44
armnn::ClConvertFp32ToFp16Workload
Definition: ClConvertFp32ToFp16Workload.hpp:17
armnn::BoostLogSeverityMapping::info
@ info
ICLTensorProxy.hpp
armnn::Status
Status
Definition: Types.hpp:42
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition: 01_00_quick_start.dox:6
armnn::ClConvertFp32ToFp16Workload::ReplaceOutputTensorHandle
void ReplaceOutputTensorHandle(ITensorHandle *tensorHandle, unsigned int slot) override
Definition: ClConvertFp32ToFp16Workload.cpp:81
armnn::MultiTypedWorkload
Definition: Workload.hpp:160