ArmNN
 25.11
Loading...
Searching...
No Matches
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
8
10
11#include <ResolveType.hpp>
12
13namespace armnn
14{
15
16template <armnn::DataType DataType>
18{
19 Execute(m_Data.m_Inputs, m_Data.m_Outputs);
20}
21
22template <armnn::DataType DataType>
23void 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
38template class RefPermuteWorkload<DataType::BFloat16>;
39template class RefPermuteWorkload<DataType::Float16>;
40template class RefPermuteWorkload<DataType::Float32>;
41template class RefPermuteWorkload<DataType::QAsymmS8>;
42template class RefPermuteWorkload<DataType::QAsymmU8>;
43template 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
armnn::TensorInfo GetTensorInfo(unsigned int numberOfBatches, unsigned int numberOfChannels, unsigned int height, unsigned int width, const armnn::DataLayout dataLayout, const armnn::DataType dataType)