blob: 93c883d826260d3bc1c25782cd12fa6caf8ff5ac [file] [log] [blame]
telsoa014fcda012018-03-09 14:13:49 +00001//
2// Copyright © 2017 Arm Ltd. All rights reserved.
3// See LICENSE file in the project root for full license information.
4//
5
6#include "RefPermuteWorkload.hpp"
7#include "RefWorkloadUtils.hpp"
8
9#include <Permute.hpp>
telsoa01c577f2c2018-08-31 09:22:23 +010010#include "TypeUtils.hpp"
telsoa014fcda012018-03-09 14:13:49 +000011
12namespace armnn
13{
14
15template <armnn::DataType DataType>
16void RefPermuteWorkload<DataType>::Execute() const
17{
18 using T = ResolveType<DataType>;
19
20 ARMNN_SCOPED_PROFILING_EVENT(Compute::CpuRef, GetName() + "_Execute");
21
22 const ITensorHandle* src = m_Data.m_Inputs[0];
23 const ITensorHandle* dst = m_Data.m_Outputs[0];
24 const PermutationVector& mappings = m_Data.m_Parameters.m_DimMappings;
25
26 armnnUtils::Permute(GetTensorInfo(dst).GetShape(), mappings, GetConstCpuData<T>(src), GetCpuData<T>(dst));
27}
28
29template class RefPermuteWorkload<DataType::Float32>;
30template class RefPermuteWorkload<DataType::QuantisedAsymm8>;
31
32} //namespace armnn