ArmNN
 24.08
NeonTransposeWorkload.cpp
Go to the documentation of this file.
1 //
2 // Copyright © 2020-2023 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
9 
10 #include <arm_compute/core/Error.h>
11 
12 namespace armnn
13 {
14 
16  const TensorInfo& output,
17  const TransposeDescriptor& descriptor)
18 {
19  const arm_compute::TensorInfo aclInputInfo = armcomputetensorutils::BuildArmComputeTensorInfo(input);
20  const arm_compute::TensorInfo aclOutputInfo = armcomputetensorutils::BuildArmComputeTensorInfo(output);
21  const armnn::PermutationVector& mappings = descriptor.m_DimMappings;
22 
23  return arm_compute::NEPermute::validate(&aclInputInfo, &aclOutputInfo,
24  armcomputetensorutils::BuildArmComputeTransposeVector(mappings));
25 }
26 
28  const WorkloadInfo& info)
30 {
31  // Report Profiling Details
32  ARMNN_REPORT_PROFILING_WORKLOAD_DESC("NeonTransposeWorkload_Construct",
33  descriptor.m_Parameters,
34  info,
35  this->GetGuid());
36 
38 
39  const arm_compute::ITensor& input = static_cast<IAclTensorHandle*>(m_Data.m_Inputs[0])->GetTensor();
40  arm_compute::ITensor& output = static_cast<IAclTensorHandle*>(m_Data.m_Outputs[0])->GetTensor();
42 
43  // Run the layer.
44  m_PermuteFunction.configure(&input, &output,
45  armcomputetensorutils::BuildArmComputeTransposeVector(mappings));
46 }
47 
49 {
50  ARMNN_SCOPED_PROFILING_EVENT_NEON_NAME_GUID("NeonTransposeWorkload_Execute");
51  m_PermuteFunction.run();
52 }
53 
54 } // namespace armnn
armnn::NeonTransposeWorkload::NeonTransposeWorkload
NeonTransposeWorkload(const TransposeQueueDescriptor &descriptor, const WorkloadInfo &info)
Definition: NeonTransposeWorkload.cpp:27
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
NeonTensorHandle.hpp
armnn::BaseWorkload< TransposeQueueDescriptor >::GetName
virtual const std::string & GetName() const override
Definition: Workload.hpp:45
armnn::IAclTensorHandle
Definition: ArmComputeTensorHandle.hpp:16
armnn::QueueDescriptorWithParameters::m_Parameters
LayerDescriptor m_Parameters
Definition: WorkloadData.hpp:66
armnn::TransposeDescriptor
A TransposeDescriptor for the TransposeLayer.
Definition: Descriptors.hpp:1490
armnn::WorkloadInfo
Contains information about TensorInfos of a layer.
Definition: WorkloadInfo.hpp:16
armnn::NeonTransposeWorkloadValidate
arm_compute::Status NeonTransposeWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const TransposeDescriptor &descriptor)
Definition: NeonTransposeWorkload.cpp:15
NeonTransposeWorkload.hpp
armnn::PermutationVector
Definition: Types.hpp:314
armnn::BoostLogSeverityMapping::info
@ info
armnn::QueueDescriptor::m_Outputs
std::vector< ITensorHandle * > m_Outputs
Definition: WorkloadData.hpp:27
ARMNN_REPORT_PROFILING_WORKLOAD_DESC
#define ARMNN_REPORT_PROFILING_WORKLOAD_DESC(name, desc, infos, guid)
Definition: Profiling.hpp:227
armnn::TransposeDescriptor::m_DimMappings
PermutationVector m_DimMappings
Indicates how to translate tensor elements from a given source into the target destination,...
Definition: Descriptors.hpp:1514
armnn::Status
Status
Definition: Types.hpp:42
armnn::BaseWorkload< TransposeQueueDescriptor >::m_Data
TransposeQueueDescriptor m_Data
Definition: Workload.hpp:89
armnn::TransposeQueueDescriptor
Definition: WorkloadData.hpp:557
armnn::NeonTransposeWorkload::Execute
void Execute() const override
Definition: NeonTransposeWorkload.cpp:48
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition: 01_00_quick_start.dox:6
ArmComputeTensorUtils.hpp
ARMNN_SCOPED_PROFILING_EVENT_NEON_NAME_GUID
#define ARMNN_SCOPED_PROFILING_EVENT_NEON_NAME_GUID(label)
Creates a profiling event that uses GetGuid() and GetName() from the calling class.
Definition: NeonWorkloadUtils.hpp:33
armnn::NeonBaseWorkload
Definition: NeonBaseWorkload.hpp:13
armnn::QueueDescriptor::m_Inputs
std::vector< ITensorHandle * > m_Inputs
Definition: WorkloadData.hpp:26