From add078b7f9a658d52ee6e8fe6771ea0517c07674 Mon Sep 17 00:00:00 2001 From: mathad01 Date: Mon, 10 May 2021 16:51:20 +0100 Subject: IVGCVSW-5908 Update 21.05 Doxygen Documents Signed-off-by: mathad01 Change-Id: I95316d4fc5f9d10185492dc835bb2411c1daea7b --- 21.05/_cl_arg_min_max_workload_8cpp_source.xhtml | 146 +++++++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 21.05/_cl_arg_min_max_workload_8cpp_source.xhtml (limited to '21.05/_cl_arg_min_max_workload_8cpp_source.xhtml') diff --git a/21.05/_cl_arg_min_max_workload_8cpp_source.xhtml b/21.05/_cl_arg_min_max_workload_8cpp_source.xhtml new file mode 100644 index 0000000000..9dd48ba8b7 --- /dev/null +++ b/21.05/_cl_arg_min_max_workload_8cpp_source.xhtml @@ -0,0 +1,146 @@ + + + + + + + + + + + + + +ArmNN: src/backends/cl/workloads/ClArgMinMaxWorkload.cpp Source File + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  21.05 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
ClArgMinMaxWorkload.cpp
+
+
+Go to the documentation of this file.
1 //
2 // Copyright © 2019 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
7 #include "ClWorkloadUtils.hpp"
8 
10 
12 
15 
16 #include <cl/ClTensorHandle.hpp>
17 #include <cl/ClLayerSupport.hpp>
18 
19 namespace
20 {
21 unsigned int CalcAclAxis(unsigned int numDimensions, unsigned int axisIndex)
22 {
23  return (numDimensions - axisIndex) - 1;
24 }
25 
26 } //namespace
27 
28 namespace armnn
29 {
30 
32  const TensorInfo& output,
33  const ArgMinMaxDescriptor& descriptor)
34 {
35  const arm_compute::TensorInfo aclInput = armcomputetensorutils::BuildArmComputeTensorInfo(input);
36  const arm_compute::TensorInfo aclOutput = armcomputetensorutils::BuildArmComputeTensorInfo(output);
37 
38  auto numDims = input.GetNumDimensions();
39  auto unsignedAxis = armnnUtils::GetUnsignedAxis(numDims, descriptor.m_Axis);
40  int aclAxis = armnn::numeric_cast<int>(CalcAclAxis(numDims, unsignedAxis));
41 
42  if (descriptor.m_Function == ArgMinMaxFunction::Max)
43  {
44  return arm_compute::CLArgMinMaxLayer::validate(&aclInput, aclAxis, &aclOutput,
45  arm_compute::ReductionOperation::ARG_IDX_MAX);
46  }
47  else
48  {
49  return arm_compute::CLArgMinMaxLayer::validate(&aclInput, aclAxis, &aclOutput,
50  arm_compute::ReductionOperation::ARG_IDX_MIN);
51  }
52 }
53 
54 
56  const WorkloadInfo& info,
57  const arm_compute::CLCompileContext& clCompileContext)
58  : BaseWorkload<ArgMinMaxQueueDescriptor>(descriptor, info)
59 {
60  arm_compute::ICLTensor& input = static_cast<IClTensorHandle*>(this->m_Data.m_Inputs[0])->GetTensor();
61  arm_compute::ICLTensor& output = static_cast<IClTensorHandle*>(this->m_Data.m_Outputs[0])->GetTensor();
62 
63  auto numDims = info.m_InputTensorInfos[0].GetNumDimensions();
64  auto unsignedAxis = armnnUtils::GetUnsignedAxis(numDims, m_Data.m_Parameters.m_Axis);
65  int aclAxis = armnn::numeric_cast<int>(CalcAclAxis(numDims, unsignedAxis));
66 
68  {
69  m_ArgMinMaxLayer.configure(&input, aclAxis, &output, arm_compute::ReductionOperation::ARG_IDX_MAX);
70  }
71  else
72  {
73  m_ArgMinMaxLayer.configure(clCompileContext,
74  &input,
75  aclAxis,
76  &output,
77  arm_compute::ReductionOperation::ARG_IDX_MIN);
78  }
79 }
80 
82 {
83  ARMNN_SCOPED_PROFILING_EVENT_CL("ClArgMinMaxWorkload_Execute");
84  RunClFunction(m_ArgMinMaxLayer, CHECK_LOCATION());
85 }
86 
87 } //namespace armnn
88 
virtual void Execute() const override
+ + +
#define ARMNN_SCOPED_PROFILING_EVENT_CL(name)
+
void RunClFunction(arm_compute::IFunction &function, const CheckLocation &location)
+
ArgMinMaxFunction m_Function
Specify if the function is to find Min or Max.
Definition: Descriptors.hpp:70
+ +
ClArgMinMaxWorkload(const ArgMinMaxQueueDescriptor &descriptor, const WorkloadInfo &info, const arm_compute::CLCompileContext &clCompileContext)
+
Copyright (c) 2021 ARM Limited and Contributors.
+ + +
std::vector< TensorInfo > m_InputTensorInfos
+ + +
An ArgMinMaxDescriptor for ArgMinMaxLayer.
Definition: Descriptors.hpp:56
+ + +
unsigned int GetUnsignedAxis(const unsigned int inputDimension, const int axis)
+
Status
enumeration
Definition: Types.hpp:30
+
#define CHECK_LOCATION()
Definition: Exceptions.hpp:197
+ + +
std::vector< ITensorHandle * > m_Outputs
+ + +
std::enable_if_t< std::is_unsigned< Source >::value &&std::is_unsigned< Dest >::value, Dest > numeric_cast(Source source)
Definition: NumericCast.hpp:35
+
arm_compute::Status ClArgMinMaxWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const ArgMinMaxDescriptor &descriptor)
+
Contains information about inputs and outputs to a layer.
+
int m_Axis
Axis to reduce across the input tensor.
Definition: Descriptors.hpp:72
+
std::vector< ITensorHandle * > m_Inputs
+ +
unsigned int GetNumDimensions() const
Definition: Tensor.hpp:191
+ +
+
+ + + + -- cgit v1.2.1