blob: 4d43b7e560987dc17b5f89751bcc364894a97281 [file] [log] [blame]
telsoa014fcda012018-03-09 14:13:49 +00001//
2// Copyright © 2017 Arm Ltd. All rights reserved.
David Beckecb56cd2018-09-05 12:52:57 +01003// SPDX-License-Identifier: MIT
telsoa014fcda012018-03-09 14:13:49 +00004//
5
6#include "RefPermuteWorkload.hpp"
7#include "RefWorkloadUtils.hpp"
8
9#include <Permute.hpp>
Aron Virginas-Tard4f0fea2019-04-09 14:08:06 +010010#include <ResolveType.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];
Matthew Bentham4cefc412019-06-18 16:14:34 +010023 ITensorHandle* dst = m_Data.m_Outputs[0];
telsoa014fcda012018-03-09 14:13:49 +000024 const PermutationVector& mappings = m_Data.m_Parameters.m_DimMappings;
25
Matteo Martincighd5b9e642019-01-04 18:01:21 +000026 armnnUtils::Permute(GetTensorInfo(dst).GetShape(), mappings,
Matthew Bentham4cefc412019-06-18 16:14:34 +010027 src->Map(), dst->Map(), sizeof(T));
telsoa014fcda012018-03-09 14:13:49 +000028}
29
arovir01616e7752018-10-01 17:08:59 +010030template class RefPermuteWorkload<DataType::Float16>;
telsoa014fcda012018-03-09 14:13:49 +000031template class RefPermuteWorkload<DataType::Float32>;
32template class RefPermuteWorkload<DataType::QuantisedAsymm8>;
Narumol Prangnawarat86bb4e12019-07-08 11:36:05 +010033template class RefPermuteWorkload<DataType::QuantisedSymm16>;
telsoa014fcda012018-03-09 14:13:49 +000034
35} //namespace armnn