ArmNN
 25.02
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RefPermuteWorkload.cpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017-2024 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #include "RefPermuteWorkload.hpp"
7 #include "RefWorkloadUtils.hpp"
8 
9 #include <armnnUtils/Permute.hpp>
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 RefPermuteWorkload<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("RefPermuteWorkload_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::Permute(GetTensorInfo(dst).GetShape(), mappings,
35  src->Map(), dst->Map(), sizeof(T));
36 }
37 
38 template class RefPermuteWorkload<DataType::BFloat16>;
39 template class RefPermuteWorkload<DataType::Float16>;
40 template class RefPermuteWorkload<DataType::Float32>;
41 template class RefPermuteWorkload<DataType::QAsymmS8>;
42 template class RefPermuteWorkload<DataType::QAsymmU8>;
43 template class RefPermuteWorkload<DataType::QSymmS16>;
44 
45 } //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.
void Execute() const override
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 Permute(const armnn::TensorShape &dstShape, const armnn::PermutationVector &mappings, const void *src, void *dst, size_t dataTypeSize)
Definition: Permute.cpp:164