ArmNN
 24.08
NeonStridedSliceWorkload Class Reference

#include <NeonStridedSliceWorkload.hpp>

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

Public Member Functions

 NeonStridedSliceWorkload (const StridedSliceQueueDescriptor &descriptor, const WorkloadInfo &info)
 
virtual void Execute () const override
 
- Public Member Functions inherited from NeonBaseWorkload< StridedSliceQueueDescriptor >
 NeonBaseWorkload (const StridedSliceQueueDescriptor &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< StridedSliceQueueDescriptor >
 BaseWorkload (const StridedSliceQueueDescriptor &descriptor, const WorkloadInfo &info)
 
virtual const std::string & GetName () const override
 
void ExecuteAsync (ExecutionData &executionData) override
 
void PostAllocationConfigure () override
 
const StridedSliceQueueDescriptorGetData () 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< StridedSliceQueueDescriptor >
virtual void Reconfigure ()
 
- Protected Attributes inherited from BaseWorkload< StridedSliceQueueDescriptor >
StridedSliceQueueDescriptor m_Data
 
const arm::pipe::ProfilingGuid m_Guid
 
const std::string m_Name
 

Detailed Description

Definition at line 24 of file NeonStridedSliceWorkload.hpp.

Constructor & Destructor Documentation

◆ NeonStridedSliceWorkload()

NeonStridedSliceWorkload ( const StridedSliceQueueDescriptor descriptor,
const WorkloadInfo info 
)

Definition at line 51 of file NeonStridedSliceWorkload.cpp.

53  : NeonBaseWorkload<StridedSliceQueueDescriptor>(descriptor, info)
54 {
55  // Report Profiling Details
56  ARMNN_REPORT_PROFILING_WORKLOAD_DESC("NeonStridedSliceWorkload_Construct",
57  descriptor.m_Parameters,
58  info,
59  this->GetGuid());
60 
61  m_Data.ValidateInputsOutputs("NeonStridedSliceWorkload", 1, 1);
62 
63  arm_compute::ITensor& input = PolymorphicDowncast<IAclTensorHandle*>(m_Data.m_Inputs[0])->GetTensor();
64  arm_compute::ITensor& output = PolymorphicDowncast<IAclTensorHandle*>(m_Data.m_Outputs[0])->GetTensor();
65 
69 
70  std::tie(starts, ends, strides) = SetNeonStridedSliceData(m_Data.m_Parameters.m_Begin,
73 
74  auto numDimensions = armnn::numeric_cast<int>(info.m_InputTensorInfos[0].GetNumDimensions());
75  int32_t begin_mask = ConvertMaskToACLFormat(m_Data.m_Parameters.m_BeginMask, numDimensions);
76  int32_t end_mask = ConvertMaskToACLFormat(m_Data.m_Parameters.m_EndMask, numDimensions);
77  int32_t shrink_axis_mask = ConvertMaskToACLFormat(m_Data.m_Parameters.m_ShrinkAxisMask, numDimensions);
78 
79  arm_compute::DataLayout aclDataLayout = ConvertDataLayout(m_Data.m_Parameters.m_DataLayout);
80  input.info()->set_data_layout(aclDataLayout);
81  output.info()->set_data_layout(aclDataLayout);
82 
83  auto layer = std::make_unique<arm_compute::NEStridedSlice>();
84 
85  layer->configure(&input,
86  &output,
87  starts,
88  ends,
89  strides,
90  begin_mask,
91  end_mask,
92  shrink_axis_mask);
93  m_Layer.reset(layer.release());
94 }

References ARMNN_REPORT_PROFILING_WORKLOAD_DESC, armnn::ConvertMaskToACLFormat(), armnn::info, StridedSliceDescriptor::m_Begin, StridedSliceDescriptor::m_BeginMask, BaseWorkload< StridedSliceQueueDescriptor >::m_Data, StridedSliceDescriptor::m_End, StridedSliceDescriptor::m_EndMask, QueueDescriptor::m_Inputs, QueueDescriptor::m_Outputs, QueueDescriptorWithParameters< LayerDescriptor >::m_Parameters, StridedSliceDescriptor::m_ShrinkAxisMask, StridedSliceDescriptor::m_Stride, armnn::SetNeonStridedSliceData(), and QueueDescriptor::ValidateInputsOutputs().

Member Function Documentation

◆ Execute()

void Execute ( ) const
overridevirtual

Implements IWorkload.

Definition at line 96 of file NeonStridedSliceWorkload.cpp.

97 {
98  ARMNN_SCOPED_PROFILING_EVENT_NEON_NAME_GUID("NeonStridedSliceWorkload_Execute");
99  m_Layer->run();
100 }

References ARMNN_SCOPED_PROFILING_EVENT_NEON_NAME_GUID.


The documentation for this class was generated from the following files:
armnn::DataLayout
DataLayout
Definition: Types.hpp:62
armnn::StridedSliceDescriptor::m_Begin
std::vector< int > m_Begin
Begin values for the input that will be sliced.
Definition: Descriptors.hpp:1342
armnn::QueueDescriptor::ValidateInputsOutputs
void ValidateInputsOutputs(const std::string &descName, unsigned int numExpectedIn, unsigned int numExpectedOut) const
Definition: WorkloadData.cpp:447
armnn::SetNeonStridedSliceData
auto SetNeonStridedSliceData(const std::vector< int > &m_begin, const std::vector< int > &m_end, const std::vector< int > &m_stride)
Definition: NeonWorkloadUtils.hpp:138
armnn::StridedSliceDescriptor::m_BeginMask
int32_t m_BeginMask
Begin mask value.
Definition: Descriptors.hpp:1350
armnn::Coordinates
std::array< unsigned int, MaxNumOfTensorDimensions > Coordinates
Definition: InternalTypes.hpp:15
armnn::StridedSliceDescriptor::m_DataLayout
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
Definition: Descriptors.hpp:1363
armnn::QueueDescriptorWithParameters::m_Parameters
LayerDescriptor m_Parameters
Definition: WorkloadData.hpp:66
armnn::StridedSliceDescriptor::m_EndMask
int32_t m_EndMask
End mask value.
Definition: Descriptors.hpp:1353
armnn::BoostLogSeverityMapping::info
@ info
armnn::QueueDescriptor::m_Outputs
std::vector< ITensorHandle * > m_Outputs
Definition: WorkloadData.hpp:27
armnn::StridedSliceDescriptor::m_ShrinkAxisMask
int32_t m_ShrinkAxisMask
Shrink axis mask value. If set, the nth specification shrinks the dimensionality by 1.
Definition: Descriptors.hpp:1355
ARMNN_REPORT_PROFILING_WORKLOAD_DESC
#define ARMNN_REPORT_PROFILING_WORKLOAD_DESC(name, desc, infos, guid)
Definition: Profiling.hpp:227
armnn::StridedSliceDescriptor::m_Stride
std::vector< int > m_Stride
Stride values for the input that will be sliced.
Definition: Descriptors.hpp:1346
armnn::BaseWorkload< StridedSliceQueueDescriptor >::m_Data
StridedSliceQueueDescriptor m_Data
Definition: Workload.hpp:89
armnn::ConvertMaskToACLFormat
int32_t ConvertMaskToACLFormat(int32_t mask, int32_t numDim)
Definition: WorkloadUtils.cpp:299
armnn::StridedSliceDescriptor::m_End
std::vector< int > m_End
End values for the input that will be sliced.
Definition: Descriptors.hpp:1344
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