2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
6 #include "ClSubtractionWorkload.hpp"
8 #include <backends/cl/ClTensorHandle.hpp>
9 #include <backends/CpuTensorHandle.hpp>
10 #include <backends/aclCommon/ArmComputeTensorUtils.hpp>
12 #include "ClWorkloadUtils.hpp"
16 using namespace armcomputetensorutils;
18 static constexpr arm_compute::ConvertPolicy g_AclConvertPolicy = arm_compute::ConvertPolicy::SATURATE;
20 ClSubtractionWorkload::ClSubtractionWorkload(const SubtractionQueueDescriptor& descriptor,
21 const WorkloadInfo& info)
22 : BaseWorkload<SubtractionQueueDescriptor>(descriptor, info)
24 this->m_Data.ValidateInputsOutputs("ClSubtractionWorkload", 2, 1);
26 arm_compute::ICLTensor& input0 = static_cast<IClTensorHandle*>(this->m_Data.m_Inputs[0])->GetTensor();
27 arm_compute::ICLTensor& input1 = static_cast<IClTensorHandle*>(this->m_Data.m_Inputs[1])->GetTensor();
28 arm_compute::ICLTensor& output = static_cast<IClTensorHandle*>(this->m_Data.m_Outputs[0])->GetTensor();
29 m_Layer.configure(&input0, &input1, &output, g_AclConvertPolicy);
32 void ClSubtractionWorkload::Execute() const
34 ARMNN_SCOPED_PROFILING_EVENT_CL("ClSubtractionWorkload_Execute");
38 arm_compute::Status ClSubtractionValidate(const TensorInfo& input0,
39 const TensorInfo& input1,
40 const TensorInfo& output)
42 const arm_compute::TensorInfo aclInput0Info = BuildArmComputeTensorInfo(input0);
43 const arm_compute::TensorInfo aclInput1Info = BuildArmComputeTensorInfo(input1);
44 const arm_compute::TensorInfo aclOutputInfo = BuildArmComputeTensorInfo(output);
46 const arm_compute::Status aclStatus = arm_compute::CLArithmeticSubtraction::validate(&aclInput0Info,