ArmNN
 24.08
NeonConcatWorkload Class Reference

#include <NeonConcatWorkload.hpp>

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

Public Member Functions

 NeonConcatWorkload (const ConcatQueueDescriptor &descriptor, const WorkloadInfo &info)
 
void Execute () const override
 
- Public Member Functions inherited from NeonBaseWorkload< ConcatQueueDescriptor >
 NeonBaseWorkload (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 NeonBaseWorkload< 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 22 of file NeonConcatWorkload.hpp.

Constructor & Destructor Documentation

◆ NeonConcatWorkload()

NeonConcatWorkload ( const ConcatQueueDescriptor descriptor,
const WorkloadInfo info 
)

Definition at line 49 of file NeonConcatWorkload.cpp.

51  : NeonBaseWorkload<ConcatQueueDescriptor>(descriptor, info)
52 {
53  // Report Profiling Details
54  ARMNN_REPORT_PROFILING_WORKLOAD_DESC("NeonConcatWorkload_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::ITensor *> aclInputs;
79  for (auto input : m_Data.m_Inputs)
80  {
81  arm_compute::ITensor& aclInput = armnn::PolymorphicPointerDowncast<IAclTensorHandle>(input)->GetTensor();
82  aclInputs.emplace_back(&aclInput);
83  }
84  arm_compute::ITensor& output = armnn::PolymorphicPointerDowncast<IAclTensorHandle>(
85  m_Data.m_Outputs[0])->GetTensor();
86 
87  // Create the layer function
88  m_Layer.reset(new arm_compute::NEConcatenateLayer());
89 
90  // Configure input and output tensors
91  size_t aclAxis = CalcAxis(descriptor.m_Parameters);
92  m_Layer->configure(aclInputs, &output, aclAxis);
93 
94  // Prepare
95  m_Layer->prepare();
96 }

References ARMNN_REPORT_PROFILING_WORKLOAD_DESC, 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 98 of file NeonConcatWorkload.cpp.

99 {
100  if (m_Layer)
101  {
102  ARMNN_SCOPED_PROFILING_EVENT_NEON_NAME_GUID("NeonConcatWorkload_Execute");
103  m_Layer->run();
104  }
105 }

References ARMNN_SCOPED_PROFILING_EVENT_NEON_NAME_GUID.


The documentation for this class was generated from the following files:
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_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::QueueDescriptor::m_Inputs
std::vector< ITensorHandle * > m_Inputs
Definition: WorkloadData.hpp:26