ArmNN
 24.02
ClStackWorkload Class Reference

#include <ClStackWorkload.hpp>

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

Public Member Functions

 ClStackWorkload (const StackQueueDescriptor &descriptor, const WorkloadInfo &info, const arm_compute::CLCompileContext &clCompileContext)
 
void Execute () const override
 
- Public Member Functions inherited from ClBaseWorkload< StackQueueDescriptor >
 ClBaseWorkload (const StackQueueDescriptor &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< StackQueueDescriptor >
 BaseWorkload (const StackQueueDescriptor &descriptor, const WorkloadInfo &info)
 
virtual const std::string & GetName () const override
 
void ExecuteAsync (ExecutionData &executionData) override
 
void PostAllocationConfigure () override
 
const StackQueueDescriptorGetData () 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< StackQueueDescriptor >
virtual void Reconfigure ()
 
- Protected Attributes inherited from BaseWorkload< StackQueueDescriptor >
StackQueueDescriptor m_Data
 
const arm::pipe::ProfilingGuid m_Guid
 
const std::string m_Name
 

Detailed Description

Definition at line 18 of file ClStackWorkload.hpp.

Constructor & Destructor Documentation

◆ ClStackWorkload()

ClStackWorkload ( const StackQueueDescriptor descriptor,
const WorkloadInfo info,
const arm_compute::CLCompileContext &  clCompileContext 
)

Definition at line 47 of file ClStackWorkload.cpp.

50 : ClBaseWorkload<StackQueueDescriptor>(descriptor, info)
51 {
52  // Report Profiling Details
53  ARMNN_REPORT_PROFILING_WORKLOAD_DESC("ClStackWorkload_Construct",
54  descriptor.m_Parameters,
55  info,
56  this->GetGuid());
57 
58  std::vector<arm_compute::ICLTensor*> aclInputs;
59  for (auto input : m_Data.m_Inputs)
60  {
61  arm_compute::ICLTensor& aclInput = armnn::PolymorphicPointerDowncast<IClTensorHandle>(input)->GetTensor();
62  aclInputs.emplace_back(&aclInput);
63  }
64  arm_compute::ICLTensor& output = armnn::PolymorphicPointerDowncast<IClTensorHandle>(
65  m_Data.m_Outputs[0])->GetTensor();
66 
67  m_Layer.reset(new arm_compute::CLStackLayer());
68  int aclAxis = CalcAxis(descriptor.m_Parameters.m_Axis, descriptor.m_Parameters.m_InputShape.GetNumDimensions());
69  {
70  ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID("ClStackWorkload_configure");
71  m_Layer->configure(clCompileContext, aclInputs, aclAxis, &output);
72  }
73 }

References ARMNN_REPORT_PROFILING_WORKLOAD_DESC, ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID, TensorShape::GetNumDimensions(), armnn::info, StackDescriptor::m_Axis, BaseWorkload< StackQueueDescriptor >::m_Data, QueueDescriptor::m_Inputs, StackDescriptor::m_InputShape, QueueDescriptor::m_Outputs, and QueueDescriptorWithParameters< LayerDescriptor >::m_Parameters.

Member Function Documentation

◆ Execute()

void Execute ( ) const
overridevirtual

Implements IWorkload.

Definition at line 75 of file ClStackWorkload.cpp.

76 {
77  if (m_Layer)
78  {
79  ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID("ClStackWorkload_Execute");
80  m_Layer->run();
81  }
82 }

References ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID.


The documentation for this class was generated from the following files:
m_Layer
IConnectableLayer * m_Layer
Definition: SubgraphViewSelector.cpp:247
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< StackQueueDescriptor >::m_Data
StackQueueDescriptor m_Data
Definition: Workload.hpp:89
armnn::QueueDescriptor::m_Inputs
std::vector< ITensorHandle * > m_Inputs
Definition: WorkloadData.hpp:26