ArmNN
 24.02
RefReverseV2Workload.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 
8 #include "ReverseV2Impl.hpp"
9 #include "RefWorkloadUtils.hpp"
10 #include "Profiling.hpp"
11 
12 namespace armnn
13 {
14 
16  : RefBaseWorkload(descriptor, info)
17  {}
18 
20  {
22  }
23 
25  {
26  WorkingMemDescriptor* workingMemDescriptor = static_cast<WorkingMemDescriptor*>(executionData.m_Data);
27  Execute(workingMemDescriptor->m_Inputs, workingMemDescriptor->m_Outputs);
28  }
29 
30  void RefReverseV2Workload::Execute(std::vector<ITensorHandle*> inputs, std::vector<ITensorHandle*> outputs) const
31  {
32  ARMNN_SCOPED_PROFILING_EVENT_REF_NAME_GUID("RefReverseV2Workload_Execute");
33 
34  const TensorInfo& inputInfo = GetTensorInfo(inputs[0]);
35  const TensorInfo& axisInfo = GetTensorInfo(inputs[1]);
36 
37  std::unique_ptr<Decoder<float>> inputDecoder = MakeDecoder<float>(GetTensorInfo(inputs[0]),
38  inputs[0]->Map());
39 
40  std::unique_ptr<Decoder<int>> axisDecoder = MakeDecoder<int>(GetTensorInfo(inputs[1]),
41  inputs[1]->Map());
42 
43  std::unique_ptr<Encoder<float>> outputEncoder = MakeEncoder<float>(GetTensorInfo(outputs[0]),
44  outputs[0]->Map());
45 
46  ReverseV2(inputInfo,
47  axisInfo,
48  *inputDecoder,
49  *axisDecoder,
50  *outputEncoder);
51  }
52 
53 } // namespace armnn
armnn::RefReverseV2Workload::Execute
void Execute() const override
Definition: RefReverseV2Workload.cpp:19
armnn::experimental::ExecutionData::m_Data
void * m_Data
Definition: ExecutionData.hpp:16
armnn::TensorInfo
Definition: Tensor.hpp:152
Profiling.hpp
ARMNN_SCOPED_PROFILING_EVENT_REF_NAME_GUID
#define ARMNN_SCOPED_PROFILING_EVENT_REF_NAME_GUID(label)
Creates a profiling event that uses GetGuid() and GetName() from the calling class.
Definition: RefWorkloadUtils.hpp:22
armnn::ReverseV2QueueDescriptor
Definition: WorkloadData.hpp:758
armnn::ReverseV2
void ReverseV2(const TensorInfo &inputInfo, const TensorInfo &axisInfo, Decoder< float > &inputDecoder, Decoder< int > &axisDecoder, Encoder< float > &outputEncoder)
Definition: ReverseV2Impl.cpp:78
armnn::WorkloadInfo
Contains information about TensorInfos of a layer.
Definition: WorkloadInfo.hpp:16
armnn::GetTensorInfo
const TensorInfo & GetTensorInfo(const ITensorHandle *tensorHandle)
float32 helpers
Definition: RefWorkloadUtils.hpp:33
RefReverseV2Workload.hpp
armnn::BoostLogSeverityMapping::info
@ info
armnn::QueueDescriptor::m_Outputs
std::vector< ITensorHandle * > m_Outputs
Definition: WorkloadData.hpp:27
RefWorkloadUtils.hpp
ReverseV2Impl.hpp
armnn::BaseWorkload< ReverseV2QueueDescriptor >::m_Data
ReverseV2QueueDescriptor m_Data
Definition: Workload.hpp:89
armnn::RefReverseV2Workload::ExecuteAsync
void ExecuteAsync(ExecutionData &executionData) override
Definition: RefReverseV2Workload.cpp:24
armnn::LayerType::Map
@ Map
armnn::experimental::WorkingMemDescriptor::m_Inputs
std::vector< ITensorHandle * > m_Inputs
Definition: WorkingMemDescriptor.hpp:20
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition: 01_00_quick_start.dox:6
armnn::experimental::WorkingMemDescriptor
Definition: WorkingMemDescriptor.hpp:18
armnn::RefReverseV2Workload::RefReverseV2Workload
RefReverseV2Workload(const ReverseV2QueueDescriptor &descriptor, const WorkloadInfo &info)
Definition: RefReverseV2Workload.cpp:15
armnn::RefBaseWorkload
Definition: RefBaseWorkload.hpp:13
armnn::experimental::WorkingMemDescriptor::m_Outputs
std::vector< ITensorHandle * > m_Outputs
Definition: WorkingMemDescriptor.hpp:21
armnn::QueueDescriptor::m_Inputs
std::vector< ITensorHandle * > m_Inputs
Definition: WorkloadData.hpp:26
armnn::experimental::ExecutionData
Definition: ExecutionData.hpp:14