telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1 | // |
| 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> |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame^] | 10 | #include "TypeUtils.hpp" |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 11 | |
| 12 | namespace armnn |
| 13 | { |
| 14 | |
| 15 | template <armnn::DataType DataType> |
| 16 | void 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 | |
| 29 | template class RefPermuteWorkload<DataType::Float32>; |
| 30 | template class RefPermuteWorkload<DataType::QuantisedAsymm8>; |
| 31 | |
| 32 | } //namespace armnn |