• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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>
Execute() const17 void RefPermuteWorkload<DataType>::Execute() const
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 
31 template class RefPermuteWorkload<DataType::BFloat16>;
32 template class RefPermuteWorkload<DataType::Float16>;
33 template class RefPermuteWorkload<DataType::Float32>;
34 template class RefPermuteWorkload<DataType::QAsymmS8>;
35 template class RefPermuteWorkload<DataType::QAsymmU8>;
36 template class RefPermuteWorkload<DataType::QSymmS16>;
37 
38 } //namespace armnn
39