ArmNN
 21.02
NeonPermuteWorkload.cpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd. 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  : BaseWorkload<PermuteQueueDescriptor>(descriptor, info)
30 {
31  using armcomputetensorutils::BuildArmComputePermutationVector;
32 
34 
35  const arm_compute::ITensor& input = static_cast<IAclTensorHandle*>(m_Data.m_Inputs[0])->GetTensor();
36  arm_compute::ITensor& output = static_cast<IAclTensorHandle*>(m_Data.m_Outputs[0])->GetTensor();
38 
39  // Run the layer.
40  m_PermuteFunction.configure(&input, &output, BuildArmComputePermutationVector(mappings));
41 }
42 
44 {
46  m_PermuteFunction.run();
47 }
48 
49 } // namespace armnn
const PermuteQueueDescriptor m_Data
Definition: Workload.hpp:46
#define ARMNN_SCOPED_PROFILING_EVENT_NEON(name)
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:26
arm_compute::Status NeonPermuteWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const PermuteDescriptor &descriptor)
void Execute() const override
std::vector< ITensorHandle * > m_Outputs
Contains information about inputs and outputs to a layer.
std::vector< ITensorHandle * > m_Inputs
static const std::string & GetName()
NeonPermuteWorkload(const PermuteQueueDescriptor &descriptor, const WorkloadInfo &info)
A PermuteDescriptor for the PermuteLayer.