ArmNN
 24.08
ClConcatWorkload Class Reference

#include <ClConcatWorkload.hpp>

Inheritance diagram for ClConcatWorkload:
[legend]
Collaboration diagram for ClConcatWorkload:
[legend]

Public Member Functions

 ClConcatWorkload (const ConcatQueueDescriptor &descriptor, const WorkloadInfo &info, const arm_compute::CLCompileContext &clCompileContext)
 
void Execute () const override
 
- Public Member Functions inherited from ClBaseWorkload< ConcatQueueDescriptor >
 ClBaseWorkload (const ConcatQueueDescriptor &descriptor, const WorkloadInfo &info)
 
void ReplaceInputTensorHandle (ITensorHandle *tensorHandle, unsigned int slot) override
 
void ReplaceOutputTensorHandle (ITensorHandle *tensorHandle, unsigned int slot) override
 
- Public Member Functions inherited from BaseWorkload< ConcatQueueDescriptor >
 BaseWorkload (const ConcatQueueDescriptor &descriptor, const WorkloadInfo &info)
 
virtual const std::string & GetName () const override
 
void ExecuteAsync (ExecutionData &executionData) override
 
void PostAllocationConfigure () override
 
const ConcatQueueDescriptorGetData () const
 
arm::pipe::ProfilingGuid GetGuid () const final
 
virtual bool SupportsTensorHandleReplacement () const override
 
- Public Member Functions inherited from IWorkload
virtual ~IWorkload ()
 
virtual arm::pipe::ProfilingGuid GetGuid () const =0
 
virtual bool SupportsTensorHandleReplacement () const =0
 
virtual const std::string & GetName () const =0
 
virtual void RegisterDebugCallback (const DebugCallbackFunction &)
 
virtual armnn::Optional< armnn::MemoryRequirementsGetMemoryRequirements ()
 

Additional Inherited Members

- Protected Member Functions inherited from ClBaseWorkload< ConcatQueueDescriptor >
virtual void Reconfigure ()
 
- Protected Attributes inherited from BaseWorkload< ConcatQueueDescriptor >
ConcatQueueDescriptor m_Data
 
const arm::pipe::ProfilingGuid m_Guid
 
const std::string m_Name
 

Detailed Description

Definition at line 21 of file ClConcatWorkload.hpp.

Constructor & Destructor Documentation

◆ ClConcatWorkload()

ClConcatWorkload ( const ConcatQueueDescriptor descriptor,
const WorkloadInfo info,
const arm_compute::CLCompileContext &  clCompileContext 
)

Definition at line 48 of file ClConcatWorkload.cpp.

51 : ClBaseWorkload<ConcatQueueDescriptor>(descriptor, info)
52 {
53  // Report Profiling Details
54  ARMNN_REPORT_PROFILING_WORKLOAD_DESC("ClConcatWorkload_Construct",
55  descriptor.m_Parameters,
56  info,
57  this->GetGuid());
58 
59  bool allInputsAreSubtensors = true;
60 
61  // Check that all inputs are sub-tensors
62  for (auto input : descriptor.m_Inputs)
63  {
64  if (!input->GetParent())
65  {
66  // Non sub-tensor input found so we need to execute the concat function
67  allInputsAreSubtensors = false;
68  break;
69  }
70  }
71 
72  if (allInputsAreSubtensors)
73  {
74  // Can skip configuring the concat function since it's not executed
75  return;
76  }
77 
78  std::vector<const arm_compute::ICLTensor *> aclInputs;
79  for (auto input : m_Data.m_Inputs)
80  {
81  arm_compute::ICLTensor& aclInput = armnn::PolymorphicPointerDowncast<IClTensorHandle>(input)->GetTensor();
82  aclInputs.emplace_back(&aclInput);
83  }
84 
85  arm_compute::ICLTensor& output =
86  armnn::PolymorphicPointerDowncast<IClTensorHandle>(m_Data.m_Outputs[0])->GetTensor();
87 
88  // Create the layer function
89  auto layer = std::make_unique<arm_compute::CLConcatenateLayer>();
90 
91  {
92  ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID("ClConcatWorkload_configure");
93  // Configure input and output tensors
94  size_t aclAxis = CalcAxis(descriptor.m_Parameters);
95  layer->configure(clCompileContext, aclInputs, &output, aclAxis);
96  }
97 
98  // Prepare
99  layer->prepare();
100  m_Layer = std::move(layer);
101 }

References ARMNN_REPORT_PROFILING_WORKLOAD_DESC, ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID, armnn::info, BaseWorkload< ConcatQueueDescriptor >::m_Data, QueueDescriptor::m_Inputs, QueueDescriptor::m_Outputs, and QueueDescriptorWithParameters< LayerDescriptor >::m_Parameters.

Member Function Documentation

◆ Execute()

void Execute ( ) const
overridevirtual

Implements IWorkload.

Definition at line 103 of file ClConcatWorkload.cpp.

104 {
105  if (m_Layer)
106  {
107  ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID("ClConcatWorkload_Execute");
108  m_Layer->run();
109  }
110 }

References ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID.


The documentation for this class was generated from the following files:
ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID
#define ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID(label)
Creates a profiling event that uses GetGuid() and GetName() from the calling class.
Definition: ClWorkloadUtils.hpp:36
armnn::QueueDescriptor::m_Outputs
std::vector< ITensorHandle * > m_Outputs
Definition: WorkloadData.hpp:27
ARMNN_REPORT_PROFILING_WORKLOAD_DESC
#define ARMNN_REPORT_PROFILING_WORKLOAD_DESC(name, desc, infos, guid)
Definition: Profiling.hpp:227
armnn::BaseWorkload< ConcatQueueDescriptor >::m_Data
ConcatQueueDescriptor m_Data
Definition: Workload.hpp:89
armnn::QueueDescriptor::m_Inputs
std::vector< ITensorHandle * > m_Inputs
Definition: WorkloadData.hpp:26