ArmNN
 25.02
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RefArgMinMaxWorkload.cpp
Go to the documentation of this file.
1 //
2 // Copyright © 2019-2024 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
7 
8 #include "ArgMinMax.hpp"
9 #include "RefWorkloadUtils.hpp"
10 #include "Decoders.hpp"
11 #include "Profiling.hpp"
12 
13 namespace armnn
14 {
16  const ArgMinMaxQueueDescriptor& descriptor,
17  const WorkloadInfo& info)
19 
20 
22 {
24 }
25 
26 void RefArgMinMaxWorkload::Execute(std::vector<ITensorHandle*> inputs, std::vector<ITensorHandle*> outputs) const
27 {
28  ARMNN_SCOPED_PROFILING_EVENT_REF_NAME_GUID("RefArgMinMaxWorkload_Execute");
29 
30  const TensorInfo &inputTensorInfo = GetTensorInfo(inputs[0]);
31 
32  std::unique_ptr<Decoder<float>> decoderPtr = MakeDecoder<float>(inputTensorInfo, inputs[0]->Map());
33  Decoder<float> &decoder = *decoderPtr;
34 
35  const TensorInfo &outputTensorInfo = GetTensorInfo(outputs[0]);
36 
37  if (outputTensorInfo.GetDataType() == armnn::DataType::Signed32) {
38  int32_t *output = GetOutputTensorData<int32_t>(outputs[0]);
39  ArgMinMax(decoder, output, inputTensorInfo, outputTensorInfo, m_Data.m_Parameters.m_Function,
40  m_Data.m_Parameters.m_Axis);
41  } else {
42  int64_t *output = GetOutputTensorData<int64_t>(outputs[0]);
43  ArgMinMax(decoder, output, inputTensorInfo, outputTensorInfo, m_Data.m_Parameters.m_Function,
44  m_Data.m_Parameters.m_Axis);
45  }
46 }
47 
48 } //namespace armnn
#define ARMNN_SCOPED_PROFILING_EVENT_REF_NAME_GUID(label)
Creates a profiling event that uses GetGuid() and GetName() from the calling class.
QueueDescriptor m_Data
Definition: Workload.hpp:74
RefArgMinMaxWorkload(const ArgMinMaxQueueDescriptor &descriptor, const WorkloadInfo &info)
DataType GetDataType() const
Definition: Tensor.hpp:200
Copyright (c) 2021 ARM Limited and Contributors.
const TensorInfo & GetTensorInfo(const ITensorHandle *tensorHandle)
float32 helpers
void ArgMinMax(Decoder< float > &in, OUT *out, const TensorInfo &inputTensorInfo, const TensorInfo &outputTensorInfo, ArgMinMaxFunction function, int axis)
Definition: ArgMinMax.cpp:17
std::vector< ITensorHandle * > m_Inputs
std::vector< ITensorHandle * > m_Outputs
Contains information about TensorInfos of a layer.