ArmNN
 24.02
NeonPermuteWorkload.cpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017-2019,2021-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 PermuteDescriptor& 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::BuildArmComputePermutationVector(mappings));
25 }
26 
28  const WorkloadInfo& info)
30 {
31  // Report Profiling Details
32  ARMNN_REPORT_PROFILING_WORKLOAD_DESC("NeonPermuteWorkload_Construct",
33  descriptor.m_Parameters,
34  info,
35  this->GetGuid());
36 
37  using armcomputetensorutils::BuildArmComputePermutationVector;
38 
40 
41  const arm_compute::ITensor& input = static_cast<IAclTensorHandle*>(m_Data.m_Inputs[0])->GetTensor();
42  arm_compute::ITensor& output = static_cast<IAclTensorHandle*>(m_Data.m_Outputs[0])->GetTensor();
44 
45  // Run the layer.
46  m_PermuteFunction.configure(&input, &output, BuildArmComputePermutationVector(mappings));
47 }
48 
50 {
51  ARMNN_SCOPED_PROFILING_EVENT_NEON_NAME_GUID("NeonPermuteWorkload_Execute");
52  m_PermuteFunction.run();
53 }
54 
55 } // namespace armnn
armnn::QueueDescriptor::ValidateInputsOutputs
void ValidateInputsOutputs(const std::string &descName, unsigned int numExpectedIn, unsigned int numExpectedOut) const
Definition: WorkloadData.cpp:446
armnn::TensorInfo
Definition: Tensor.hpp:152
NeonPermuteWorkload.hpp
NeonTensorHandle.hpp
armnn::NeonPermuteWorkloadValidate
arm_compute::Status NeonPermuteWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const PermuteDescriptor &descriptor)
Definition: NeonPermuteWorkload.cpp:15
armnn::BaseWorkload< PermuteQueueDescriptor >::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::WorkloadInfo
Contains information about TensorInfos of a layer.
Definition: WorkloadInfo.hpp:16
armnn::PermuteDescriptor
A PermuteDescriptor for the PermuteLayer.
Definition: Descriptors.hpp:149
armnn::PermutationVector
Definition: Types.hpp:314
armnn::PermuteDescriptor::m_DimMappings
PermutationVector m_DimMappings
Indicates how to translate tensor elements from a given source into the target destination,...
Definition: Descriptors.hpp:173
armnn::BoostLogSeverityMapping::info
@ info
armnn::QueueDescriptor::m_Outputs
std::vector< ITensorHandle * > m_Outputs
Definition: WorkloadData.hpp:27
armnn::NeonPermuteWorkload::Execute
void Execute() const override
Definition: NeonPermuteWorkload.cpp:49
ARMNN_REPORT_PROFILING_WORKLOAD_DESC
#define ARMNN_REPORT_PROFILING_WORKLOAD_DESC(name, desc, infos, guid)
Definition: Profiling.hpp:227
armnn::Status
Status
Definition: Types.hpp:42
armnn::BaseWorkload< PermuteQueueDescriptor >::m_Data
PermuteQueueDescriptor m_Data
Definition: Workload.hpp:89
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition: 01_00_quick_start.dox:6
armnn::NeonPermuteWorkload::NeonPermuteWorkload
NeonPermuteWorkload(const PermuteQueueDescriptor &descriptor, const WorkloadInfo &info)
Definition: NeonPermuteWorkload.cpp:27
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:32
armnn::NeonBaseWorkload
Definition: NeonBaseWorkload.hpp:13
armnn::QueueDescriptor::m_Inputs
std::vector< ITensorHandle * > m_Inputs
Definition: WorkloadData.hpp:26
armnn::PermuteQueueDescriptor
Definition: WorkloadData.hpp:191