ArmNN
 24.08
NeonTileWorkload.cpp
Go to the documentation of this file.
1 //
2 // Copyright © 2023 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 #include "NeonTileWorkload.hpp"
6 #include "NeonWorkloadUtils.hpp"
8 #include <vector>
9 #include <algorithm>
10 
11 using namespace armnn::armcomputetensorutils;
12 namespace armnn
13 {
15  const TensorInfo& output,
16  const TileDescriptor& descriptor)
17 {
18  const arm_compute::TensorInfo aclInput = BuildArmComputeTensorInfo(input);
19  const arm_compute::TensorInfo aclOutput = BuildArmComputeTensorInfo(output);
20 
21  std::vector<unsigned int> aclMultiples = descriptor.m_Multiples;
22  std::reverse(aclMultiples.begin(),aclMultiples.end());
23 
24  return arm_compute::NETile::validate(&aclInput, &aclOutput, aclMultiples);
25 }
26 
28  const armnn::WorkloadInfo& info)
29  : BaseWorkload<TileQueueDescriptor>(descriptor, info)
30 {
31  m_Data.ValidateInputsOutputs("NeonTileWorkload", 1, 1);
32 
33  std::vector<unsigned int> aclMultiples = descriptor.m_Parameters.m_Multiples;
34  std::reverse(aclMultiples.begin(),aclMultiples.end());
35 
36  arm_compute::ITensor& input = static_cast<IAclTensorHandle*>(m_Data.m_Inputs[0])->GetTensor();
37  arm_compute::ITensor& output = static_cast<IAclTensorHandle*>(m_Data.m_Outputs[0])->GetTensor();
38  m_Layer.configure(&input, &output, aclMultiples);
39 }
40 
42 {
43  ARMNN_SCOPED_PROFILING_EVENT_NEON_NAME_GUID("NeonTileWorkload_Execute");
44  m_Layer.run();
45 }
46 } //namespace armnn
armnn::NeonTileWorkloadValidate
arm_compute::Status NeonTileWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const TileDescriptor &descriptor)
Definition: NeonTileWorkload.cpp:14
armnn::QueueDescriptor::ValidateInputsOutputs
void ValidateInputsOutputs(const std::string &descName, unsigned int numExpectedIn, unsigned int numExpectedOut) const
Definition: WorkloadData.cpp:447
armnn::TensorInfo
Definition: Tensor.hpp:152
armnn::IAclTensorHandle
Definition: ArmComputeTensorHandle.hpp:16
armnn::QueueDescriptorWithParameters::m_Parameters
LayerDescriptor m_Parameters
Definition: WorkloadData.hpp:66
armnn::WorkloadInfo
Contains information about TensorInfos of a layer.
Definition: WorkloadInfo.hpp:16
armnn::TileQueueDescriptor
Definition: WorkloadData.hpp:763
ArmComputeUtils.hpp
armnn::BoostLogSeverityMapping::info
@ info
armnn::QueueDescriptor::m_Outputs
std::vector< ITensorHandle * > m_Outputs
Definition: WorkloadData.hpp:27
armnn::BaseWorkload
Definition: Workload.hpp:33
armnn::Status
Status
Definition: Types.hpp:42
armnn::TileDescriptor::m_Multiples
std::vector< uint32_t > m_Multiples
The vector to multiply the input shape by.
Definition: Descriptors.hpp:1656
armnn::BaseWorkload< TileQueueDescriptor >::m_Data
TileQueueDescriptor m_Data
Definition: Workload.hpp:89
armnn::NeonTileWorkload::Execute
void Execute() const override
Definition: NeonTileWorkload.cpp:41
NeonWorkloadUtils.hpp
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition: 01_00_quick_start.dox:6
NeonTileWorkload.hpp
armnn::NeonTileWorkload::NeonTileWorkload
NeonTileWorkload(const TileQueueDescriptor &descriptor, const WorkloadInfo &info)
Definition: NeonTileWorkload.cpp:27
ARMNN_SCOPED_PROFILING_EVENT_NEON_NAME_GUID
#define ARMNN_SCOPED_PROFILING_EVENT_NEON_NAME_GUID(label)
Creates a profiling event that uses GetGuid() and GetName() from the calling class.
Definition: NeonWorkloadUtils.hpp:33
armnn::TileDescriptor
Definition: Descriptors.hpp:1640
armnn::QueueDescriptor::m_Inputs
std::vector< ITensorHandle * > m_Inputs
Definition: WorkloadData.hpp:26