ArmNN
 25.11
Loading...
Searching...
No Matches
NeonElementwiseBinaryWorkload Class Reference

#include <NeonElementwiseBinaryWorkload.hpp>

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

Public Member Functions

 NeonElementwiseBinaryWorkload (const ElementwiseBinaryQueueDescriptor &descriptor, const WorkloadInfo &info)
virtual void Execute () const override
Public Member Functions inherited from NeonBaseWorkload< ElementwiseBinaryQueueDescriptor >
 NeonBaseWorkload (const ElementwiseBinaryQueueDescriptor &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< ElementwiseBinaryQueueDescriptor >
 BaseWorkload (const ElementwiseBinaryQueueDescriptor &descriptor, const WorkloadInfo &info)
virtual const std::string & GetName () const override
void PostAllocationConfigure () override
const ElementwiseBinaryQueueDescriptorGetData () 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 &)
virtual armnn::Optional< armnn::MemoryRequirementsGetMemoryRequirements ()

Additional Inherited Members

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

Detailed Description

Definition at line 23 of file NeonElementwiseBinaryWorkload.hpp.

Constructor & Destructor Documentation

◆ NeonElementwiseBinaryWorkload()

Definition at line 51 of file NeonElementwiseBinaryWorkload.cpp.

53 : NeonBaseWorkload<ElementwiseBinaryQueueDescriptor>(descriptor, info)
54{
55 m_Data.ValidateInputsOutputs("NeonElementwiseBinaryWorkload", 2, 1);
56
57 arm_compute::ITensor& input1 = PolymorphicDowncast<IAclTensorHandle*>(m_Data.m_Inputs[0])->GetTensor();
58 arm_compute::ITensor& input2 = PolymorphicDowncast<IAclTensorHandle*>(m_Data.m_Inputs[1])->GetTensor();
59 arm_compute::ITensor& output = PolymorphicDowncast<IAclTensorHandle*>(m_Data.m_Outputs[0])->GetTensor();
60
61 const arm_compute::ActivationLayerInfo activationInfo = ConvertAdditionalInfoToAclActivationLayerInfo(descriptor);
62
63 ARMNN_SCOPED_PROFILING_EVENT(Compute::Undefined, "NeonElementwiseBinaryWorkload_configure");
64
65 switch (descriptor.m_Parameters.m_Operation)
66 {
68 {
69 auto powerLayer = std::make_unique<arm_compute::NEElementwisePower>();
70 powerLayer->configure(&input1, &input2, &output, activationInfo);
71 m_ElementwiseBinaryLayer.reset(powerLayer.release());
72 break;
73 }
75 {
76 auto SqDiffLayer = std::make_unique<arm_compute::NEElementwiseSquaredDiff>();
77 SqDiffLayer->configure(&input1, &input2, &output, activationInfo);
78 m_ElementwiseBinaryLayer.reset(SqDiffLayer.release());
79 break;
80 }
81 default:
82 throw InvalidArgumentException("Unknown binary operator", CHECK_LOCATION());
83 }
84}
#define CHECK_LOCATION()
#define ARMNN_SCOPED_PROFILING_EVENT(backendId, name)
arm_compute::ActivationLayerInfo ConvertAdditionalInfoToAclActivationLayerInfo(const QueueDescriptor &queueDescriptor)

References ARMNN_SCOPED_PROFILING_EVENT, CHECK_LOCATION, armnn::ConvertAdditionalInfoToAclActivationLayerInfo(), armnn::info, BaseWorkload< ElementwiseBinaryQueueDescriptor >::m_Data, ElementwiseBinaryDescriptor::m_Operation, QueueDescriptorWithParameters< LayerDescriptor >::m_Parameters, NeonBaseWorkload< ElementwiseBinaryQueueDescriptor >::NeonBaseWorkload(), armnn::PolymorphicDowncast(), armnn::Power, armnn::SqDiff, and armnn::Undefined.

Member Function Documentation

◆ Execute()

void Execute ( ) const
overridevirtual

Implements IWorkload.

Definition at line 86 of file NeonElementwiseBinaryWorkload.cpp.

87{
88 ARMNN_SCOPED_PROFILING_EVENT_NEON_NAME_GUID("NeonElementwiseBinaryWorkload_Execute");
89 m_ElementwiseBinaryLayer->run();
90}
#define ARMNN_SCOPED_PROFILING_EVENT_NEON_NAME_GUID(label)
Creates a profiling event that uses GetGuid() and GetName() from the calling class.

References ARMNN_SCOPED_PROFILING_EVENT_NEON_NAME_GUID.


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