ArmNN
 22.05.01
NeonPermuteWorkload.cpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017 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)
29  : NeonBaseWorkload<PermuteQueueDescriptor>(descriptor, 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 {
52  m_PermuteFunction.run();
53 }
54 
55 } // namespace armnn
arm::pipe::ProfilingGuid GetGuid() const final
Definition: Workload.hpp:59
void ValidateInputsOutputs(const std::string &descName, unsigned int numExpectedIn, unsigned int numExpectedOut) const
Copyright (c) 2021 ARM Limited and Contributors.
PermutationVector m_DimMappings
Indicates how to translate tensor elements from a given source into the target destination, when source and target potentially have different memory layouts e.g.
Status
enumeration
Definition: Types.hpp:42
arm_compute::Status NeonPermuteWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const PermuteDescriptor &descriptor)
void Execute() const override
std::vector< ITensorHandle * > m_Outputs
#define ARMNN_REPORT_PROFILING_WORKLOAD_DESC(name, desc, infos, guid)
Definition: Profiling.hpp:227
Contains information about TensorInfos of a layer.
std::vector< ITensorHandle * > m_Inputs
#define ARMNN_SCOPED_PROFILING_EVENT_NEON_GUID(name, guid)
static const std::string & GetName()
NeonPermuteWorkload(const PermuteQueueDescriptor &descriptor, const WorkloadInfo &info)
A PermuteDescriptor for the PermuteLayer.