ArmNN
 22.05
ClGatherWorkload Class Reference

#include <ClGatherWorkload.hpp>

Inheritance diagram for ClGatherWorkload:
ClBaseWorkload< GatherQueueDescriptor > BaseWorkload< GatherQueueDescriptor > IWorkload

Public Member Functions

 ClGatherWorkload (const GatherQueueDescriptor &descriptor, const WorkloadInfo &info, const arm_compute::CLCompileContext &clCompileContext)
 
void Execute () const override
 
- Public Member Functions inherited from ClBaseWorkload< GatherQueueDescriptor >
 ClBaseWorkload (const GatherQueueDescriptor &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< GatherQueueDescriptor >
 BaseWorkload (const GatherQueueDescriptor &descriptor, const WorkloadInfo &info)
 
void ExecuteAsync (WorkingMemDescriptor &workingMemDescriptor) override
 
void PostAllocationConfigure () override
 
const GatherQueueDescriptorGetData () const
 
arm::pipe::ProfilingGuid GetGuid () const final
 
virtual bool SupportsTensorHandleReplacement () const override
 
- Public Member Functions inherited from IWorkload
virtual ~IWorkload ()
 
virtual void RegisterDebugCallback (const DebugCallbackFunction &)
 

Additional Inherited Members

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

Detailed Description

Definition at line 19 of file ClGatherWorkload.hpp.

Constructor & Destructor Documentation

◆ ClGatherWorkload()

ClGatherWorkload ( const GatherQueueDescriptor descriptor,
const WorkloadInfo info,
const arm_compute::CLCompileContext &  clCompileContext 
)

Definition at line 29 of file ClGatherWorkload.cpp.

References ARMNN_REPORT_PROFILING_WORKLOAD_DESC, ARMNN_SCOPED_PROFILING_EVENT, armnn::ComputeAclAxis(), GatherDescriptor::m_Axis, BaseWorkload< GatherQueueDescriptor >::m_Data, QueueDescriptor::m_Inputs, WorkloadInfo::m_InputTensorInfos, QueueDescriptor::m_Outputs, QueueDescriptorWithParameters< LayerDescriptor >::m_Parameters, armnn::Undefined, and QueueDescriptor::ValidateInputsOutputs().

32  : ClBaseWorkload<GatherQueueDescriptor>(descriptor, info)
33 {
34  // Report Profiling Details
35  ARMNN_REPORT_PROFILING_WORKLOAD_DESC("ClGatherWorkload_Construct",
36  descriptor.m_Parameters,
37  info,
38  this->GetGuid());
39 
40  m_Data.ValidateInputsOutputs("ClGatherWorkload", 2, 1);
41 
42  arm_compute::ICLTensor& input = static_cast<IClTensorHandle*>(m_Data.m_Inputs[0])->GetTensor();
43  arm_compute::ICLTensor& indices = static_cast<IClTensorHandle*>(m_Data.m_Inputs[1])->GetTensor();
44  arm_compute::ICLTensor& output = static_cast<IClTensorHandle*>(m_Data.m_Outputs[0])->GetTensor();
45 
46  int aclAxis = ComputeAclAxis(descriptor.m_Parameters.m_Axis, info.m_InputTensorInfos[0]);
47 
48  {
49  ARMNN_SCOPED_PROFILING_EVENT(Compute::Undefined, "ClGatherWorkload_configure");
50  m_Layer.configure(clCompileContext, &input, &indices, &output, aclAxis);
51  }
52 };
int ComputeAclAxis(const int &armnnAxis, const armnn::TensorInfo &tensor)
Function to convert ArmNN axis (left to right) to ACL axis (right to left) ranging from [-rank...
IConnectableLayer * m_Layer
void ValidateInputsOutputs(const std::string &descName, unsigned int numExpectedIn, unsigned int numExpectedOut) const
#define ARMNN_SCOPED_PROFILING_EVENT(backendId, name)
Definition: Profiling.hpp:220
std::vector< ITensorHandle * > m_Outputs
#define ARMNN_REPORT_PROFILING_WORKLOAD_DESC(name, desc, infos, guid)
Definition: Profiling.hpp:227
std::vector< ITensorHandle * > m_Inputs

Member Function Documentation

◆ Execute()

void Execute ( ) const
overridevirtual

Implements IWorkload.

Definition at line 54 of file ClGatherWorkload.cpp.

References ARMNN_SCOPED_PROFILING_EVENT_CL_GUID, CHECK_LOCATION, BaseWorkload< GatherQueueDescriptor >::GetGuid(), and armnn::RunClFunction().

55 {
56  ARMNN_SCOPED_PROFILING_EVENT_CL_GUID("ClGatherWorkload_Execute", this->GetGuid());
58 }
#define ARMNN_SCOPED_PROFILING_EVENT_CL_GUID(name, guid)
void RunClFunction(arm_compute::IFunction &function, const CheckLocation &location)
IConnectableLayer * m_Layer
arm::pipe::ProfilingGuid GetGuid() const final
Definition: Workload.hpp:59
#define CHECK_LOCATION()
Definition: Exceptions.hpp:203

The documentation for this class was generated from the following files: