ArmNN
 24.02
ClTileWorkload.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 
6 #include "ClTileWorkload.hpp"
7 #include "ClWorkloadUtils.hpp"
9 #include <cl/ClTensorHandle.hpp>
10 #include <vector>
11 #include <algorithm>
12 
13 using namespace armnn::armcomputetensorutils;
14 namespace armnn
15 {
17  const TensorInfo& output,
18  const TileDescriptor& descriptor)
19 {
20  const arm_compute::TensorInfo aclInput = BuildArmComputeTensorInfo(input);
21  const arm_compute::TensorInfo aclOutput = BuildArmComputeTensorInfo(output);
22 
23  std::vector<uint32_t> aclMultiples = descriptor.m_Multiples;
24  std::reverse(aclMultiples.begin(),aclMultiples.end());
25 
26  return arm_compute::CLTile::validate(&aclInput, &aclOutput, aclMultiples);
27 }
28 
30  const armnn::WorkloadInfo& info,
31  const arm_compute::CLCompileContext& clCompileContext)
32  : BaseWorkload<TileQueueDescriptor>(descriptor, info)
33 {
34  m_Data.ValidateInputsOutputs("ClTileWorkload", 1, 1);
35 
36  std::vector<uint32_t> aclMultiples = descriptor.m_Parameters.m_Multiples;
37  std::reverse(aclMultiples.begin(),aclMultiples.end());
38 
39  arm_compute::ICLTensor& input = static_cast<IClTensorHandle*>(m_Data.m_Inputs[0])->GetTensor();
40  arm_compute::ICLTensor& output = static_cast<IClTensorHandle*>(m_Data.m_Outputs[0])->GetTensor();
41  m_Layer.configure(clCompileContext, &input, &output, aclMultiples);
42 }
43 
45 {
46  ARMNN_SCOPED_PROFILING_EVENT_CL_GUID("ClTileWorkload_Execute", this->GetGuid());
47  m_Layer.run();
48 }
49 
50 } //namespace armnn
armnn::ClTileWorkload::Execute
void Execute() const override
Definition: ClTileWorkload.cpp:44
armnn::QueueDescriptor::ValidateInputsOutputs
void ValidateInputsOutputs(const std::string &descName, unsigned int numExpectedIn, unsigned int numExpectedOut) const
Definition: WorkloadData.cpp:446
armnn::TensorInfo
Definition: Tensor.hpp:152
armnn::ClTileWorkload::ClTileWorkload
ClTileWorkload(const TileQueueDescriptor &descriptor, const WorkloadInfo &info, const arm_compute::CLCompileContext &clCompileContext)
Definition: ClTileWorkload.cpp:29
armnn::QueueDescriptorWithParameters::m_Parameters
LayerDescriptor m_Parameters
Definition: WorkloadData.hpp:66
ARMNN_SCOPED_PROFILING_EVENT_CL_GUID
#define ARMNN_SCOPED_PROFILING_EVENT_CL_GUID(name, guid)
Definition: ClWorkloadUtils.hpp:28
armnn::WorkloadInfo
Contains information about TensorInfos of a layer.
Definition: WorkloadInfo.hpp:16
ClWorkloadUtils.hpp
armnn::ClTileWorkloadValidate
arm_compute::Status ClTileWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const TileDescriptor &descriptor)
Definition: ClTileWorkload.cpp: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::BaseWorkload< TileQueueDescriptor >::GetGuid
arm::pipe::ProfilingGuid GetGuid() const final
Definition: Workload.hpp:67
armnn::IClTensorHandle
Definition: IClTensorHandle.hpp:13
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
ClTensorHandle.hpp
armnn::BaseWorkload< TileQueueDescriptor >::m_Data
TileQueueDescriptor m_Data
Definition: Workload.hpp:89
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition: 01_00_quick_start.dox:6
ClTileWorkload.hpp
armnn::TileDescriptor
Definition: Descriptors.hpp:1640
armnn::QueueDescriptor::m_Inputs
std::vector< ITensorHandle * > m_Inputs
Definition: WorkloadData.hpp:26