ArmNN
 25.02
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RefTransposeWorkload.cpp
Go to the documentation of this file.
1 //
2 // Copyright © 2020-2024 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
7 #include "RefWorkloadUtils.hpp"
8 
10 
11 #include <ResolveType.hpp>
12 
13 namespace armnn
14 {
15 
16 template <armnn::DataType DataType>
18 {
19  Execute(m_Data.m_Inputs, m_Data.m_Outputs);
20 }
21 
22 template <armnn::DataType DataType>
23 void RefTransposeWorkload<DataType>::Execute(std::vector<ITensorHandle*> inputs,
24  std::vector<ITensorHandle*> outputs) const
25 {
26  using T = ResolveType<DataType>;
27 
28  ARMNN_SCOPED_PROFILING_EVENT_REF_NAME_GUID("RefTransposeWorkload_Execute");
29 
30  const ITensorHandle* src = inputs[0];
31  ITensorHandle* dst = outputs[0];
32  const PermutationVector& mappings = m_Data.m_Parameters.m_DimMappings;
33 
34  armnnUtils::Transpose(GetTensorInfo(src).GetShape(), mappings, src->Map(), dst->Map(), sizeof(T));
35 }
36 
37 template class RefTransposeWorkload<DataType::BFloat16>;
38 template class RefTransposeWorkload<DataType::Float16>;
39 template class RefTransposeWorkload<DataType::Float32>;
40 template class RefTransposeWorkload<DataType::QAsymmS8>;
41 template class RefTransposeWorkload<DataType::QAsymmU8>;
42 template class RefTransposeWorkload<DataType::QSymmS16>;
43 
44 } //namespace armnn
#define ARMNN_SCOPED_PROFILING_EVENT_REF_NAME_GUID(label)
Creates a profiling event that uses GetGuid() and GetName() from the calling class.
virtual const void * Map(bool blocking=true) const =0
Map the tensor data for access.
Copyright (c) 2021 ARM Limited and Contributors.
typename ResolveTypeImpl< DT >::Type ResolveType
Definition: ResolveType.hpp:79
const TensorInfo & GetTensorInfo(const ITensorHandle *tensorHandle)
float32 helpers
void Transpose(const armnn::TensorShape &dstShape, const armnn::PermutationVector &mappings, const void *src, void *dst, size_t dataTypeSize)
Definition: Transpose.cpp:153