2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
6 #include "RefPermuteWorkload.hpp"
7 #include "RefWorkloadUtils.hpp"
9 #include <armnnUtils/Permute.hpp>
11 #include <ResolveType.hpp>
16 template <armnn::DataType DataType>
17 void RefPermuteWorkload<DataType>::Execute() const
19 using T = ResolveType<DataType>;
21 ARMNN_SCOPED_PROFILING_EVENT(Compute::CpuRef, GetName() + "_Execute");
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;
27 armnnUtils::Permute(GetTensorInfo(dst).GetShape(), mappings,
28 src->Map(), dst->Map(), sizeof(T));
31 template class RefPermuteWorkload<DataType::Float16>;
32 template class RefPermuteWorkload<DataType::Float32>;
33 template class RefPermuteWorkload<DataType::QuantisedAsymm8>;
34 template class RefPermuteWorkload<DataType::QuantisedSymm16>;