Mike Kelly | c9ea45a | 2020-02-28 18:11:58 +0000 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2020 Arm Ltd. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
| 6 | #include "RefTransposeWorkload.hpp" |
| 7 | #include "RefWorkloadUtils.hpp" |
| 8 | |
| 9 | #include <armnnUtils/Transpose.hpp> |
| 10 | |
| 11 | #include <ResolveType.hpp> |
| 12 | |
| 13 | namespace armnn |
| 14 | { |
| 15 | |
| 16 | template <armnn::DataType DataType> |
| 17 | void RefTransposeWorkload<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::Transpose(GetTensorInfo(src).GetShape(), mappings, src->Map(), dst->Map(), sizeof(T)); |
| 28 | } |
| 29 | |
Narumol Prangnawarat | 44179c3 | 2020-03-11 14:51:27 +0000 | [diff] [blame] | 30 | template class RefTransposeWorkload<DataType::BFloat16>; |
Mike Kelly | c9ea45a | 2020-02-28 18:11:58 +0000 | [diff] [blame] | 31 | template class RefTransposeWorkload<DataType::Float16>; |
| 32 | template class RefTransposeWorkload<DataType::Float32>; |
Sadik Armagan | 303980c | 2020-04-17 12:45:14 +0100 | [diff] [blame] | 33 | template class RefTransposeWorkload<DataType::QAsymmS8>; |
Mike Kelly | c9ea45a | 2020-02-28 18:11:58 +0000 | [diff] [blame] | 34 | template class RefTransposeWorkload<DataType::QAsymmU8>; |
| 35 | template class RefTransposeWorkload<DataType::QSymmS16>; |
| 36 | |
| 37 | } //namespace armnn |