2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
6 #include "NeonAdditionFloatWorkload.hpp"
7 #include <aclCommon/ArmComputeTensorUtils.hpp>
8 #include <backendsCommon/CpuTensorHandle.hpp>
13 arm_compute::Status NeonAdditionWorkloadValidate(const TensorInfo& input0,
14 const TensorInfo& input1,
15 const TensorInfo& output)
17 const arm_compute::TensorInfo aclInput0 = armcomputetensorutils::BuildArmComputeTensorInfo(input0);
18 const arm_compute::TensorInfo aclInput1 = armcomputetensorutils::BuildArmComputeTensorInfo(input1);
19 const arm_compute::TensorInfo aclOutput = armcomputetensorutils::BuildArmComputeTensorInfo(output);
21 return arm_compute::NEArithmeticAddition::validate(&aclInput0,
24 arm_compute::ConvertPolicy::SATURATE);
28 NeonAdditionFloatWorkload::NeonAdditionFloatWorkload(const AdditionQueueDescriptor& descriptor,
29 const WorkloadInfo& info)
30 : FloatWorkload<AdditionQueueDescriptor>(descriptor, info)
32 m_Data.ValidateInputsOutputs("NeonAdditionFloatWorkload", 2, 1);
34 arm_compute::ITensor& input1 = boost::polymorphic_downcast<INeonTensorHandle*>(m_Data.m_Inputs[0])->GetTensor();
35 arm_compute::ITensor& input2 = boost::polymorphic_downcast<INeonTensorHandle*>(m_Data.m_Inputs[1])->GetTensor();
36 arm_compute::ITensor& output = boost::polymorphic_downcast<INeonTensorHandle*>(m_Data.m_Outputs[0])->GetTensor();
38 m_AddLayer.configure(&input1, &input2, &output, arm_compute::ConvertPolicy::SATURATE);
41 void NeonAdditionFloatWorkload::Execute() const
43 ARMNN_SCOPED_PROFILING_EVENT_NEON("NeonAdditionFloatWorkload_Execute");