ArmNN
 24.08
ClReverseV2Workload.cpp
Go to the documentation of this file.
1 //
2 // Copyright © 2023 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
7 #include "ClWorkloadUtils.hpp"
9 #include <cl/ClTensorHandle.hpp>
11 
12 using namespace armnn::armcomputetensorutils;
13 
14 namespace armnn
15 {
17  const TensorInfo& axis,
18  const TensorInfo& output)
19 {
20  const arm_compute::TensorInfo aclInput = BuildArmComputeTensorInfo(input);
21  const arm_compute::TensorInfo aclAxis = BuildArmComputeTensorInfo(axis);
22  const arm_compute::TensorInfo aclOutput = BuildArmComputeTensorInfo(output);
23 
24  return arm_compute::CLReverse::validate(&aclInput, &aclOutput, &aclAxis, true);
25 }
26 
28  const armnn::WorkloadInfo &info,
29  const arm_compute::CLCompileContext& clCompileContext)
31 {
32  m_Data.ValidateInputsOutputs("ClReverseV2Workload", 2, 1);
33 
34  arm_compute::ICLTensor& input = static_cast<IClTensorHandle*>(m_Data.m_Inputs[0])->GetTensor();
35  arm_compute::ICLTensor& axis = static_cast<IClTensorHandle*>(m_Data.m_Inputs[1])->GetTensor();
36  arm_compute::ICLTensor& output = static_cast<IClTensorHandle*>(m_Data.m_Outputs[0])->GetTensor();
37 
38  {
39  ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID("ClReverseV2Workload_configure");
40  m_Layer.configure(clCompileContext, &input, &output, &axis, true);
41  }
42 }
43 
45 {
46  ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID("ClReverseV2Workload_Execute");
47  m_Layer.run();
48 }
49 
50 } //namespace armnn
armnn::ClReverseV2Workload::ClReverseV2Workload
ClReverseV2Workload(const ReverseV2QueueDescriptor &descriptor, const WorkloadInfo &info, const arm_compute::CLCompileContext &clCompileContext)
Definition: ClReverseV2Workload.cpp:27
WorkloadUtils.hpp
armnn::QueueDescriptor::ValidateInputsOutputs
void ValidateInputsOutputs(const std::string &descName, unsigned int numExpectedIn, unsigned int numExpectedOut) const
Definition: WorkloadData.cpp:447
armnn::TensorInfo
Definition: Tensor.hpp:152
ClReverseV2Workload.hpp
armnn::ReverseV2QueueDescriptor
Definition: WorkloadData.hpp:758
armnn::ClReverseV2Workload::Execute
void Execute() const override
Definition: ClReverseV2Workload.cpp:44
ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID
#define ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID(label)
Creates a profiling event that uses GetGuid() and GetName() from the calling class.
Definition: ClWorkloadUtils.hpp:36
armnn::WorkloadInfo
Contains information about TensorInfos of a layer.
Definition: WorkloadInfo.hpp:16
ClWorkloadUtils.hpp
armnn::ClReverseV2WorkloadValidate
arm_compute::Status ClReverseV2WorkloadValidate(const TensorInfo &input, const TensorInfo &axis, const TensorInfo &output)
Definition: ClReverseV2Workload.cpp:16
ArmComputeUtils.hpp
armnn::BoostLogSeverityMapping::info
@ info
armnn::QueueDescriptor::m_Outputs
std::vector< ITensorHandle * > m_Outputs
Definition: WorkloadData.hpp:27
armnn::BaseWorkload
Definition: Workload.hpp:33
armnn::IClTensorHandle
Definition: IClTensorHandle.hpp:13
armnn::Status
Status
Definition: Types.hpp:42
ClTensorHandle.hpp
armnn::BaseWorkload< ReverseV2QueueDescriptor >::m_Data
ReverseV2QueueDescriptor m_Data
Definition: Workload.hpp:89
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition: 01_00_quick_start.dox:6
armnn::QueueDescriptor::m_Inputs
std::vector< ITensorHandle * > m_Inputs
Definition: WorkloadData.hpp:26