ArmNN
 21.02
RefPermuteWorkload.cpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #include "RefPermuteWorkload.hpp"
7 #include "RefWorkloadUtils.hpp"
8 
9 #include <armnnUtils/Permute.hpp>
10 
11 #include <ResolveType.hpp>
12 
13 namespace armnn
14 {
15 
16 template <armnn::DataType DataType>
18 {
19  using T = ResolveType<DataType>;
20 
21  ARMNN_SCOPED_PROFILING_EVENT(Compute::CpuRef, GetName() + "_Execute");
22 
23  const ITensorHandle* src = m_Data.m_Inputs[0];
24  ITensorHandle* dst = m_Data.m_Outputs[0];
25  const PermutationVector& mappings = m_Data.m_Parameters.m_DimMappings;
26 
27  armnnUtils::Permute(GetTensorInfo(dst).GetShape(), mappings,
28  src->Map(), dst->Map(), sizeof(T));
29 }
30 
37 
38 } //namespace armnn
CPU Execution: Reference C++ kernels.
typename ResolveTypeImpl< DT >::Type ResolveType
Definition: ResolveType.hpp:73
Copyright (c) 2021 ARM Limited and Contributors.
#define ARMNN_SCOPED_PROFILING_EVENT(backendId, name)
Definition: Profiling.hpp:173
void Execute() const override
virtual const void * Map(bool blocking=true) const =0
Map the tensor data for access.
const TensorInfo & GetTensorInfo(const ITensorHandle *tensorHandle)
float32 helpers