Compute Library
 21.02
IGCKernel Class Referenceabstract

Common interface for all the GLES kernels. More...

#include <IGCKernel.h>

Collaboration diagram for IGCKernel:
[legend]

Public Member Functions

 IGCKernel ()
 Constructor. More...
 
GCKernelkernel ()
 Returns a reference to the GLES kernel of this object. More...
 
void add_1D_tensor_argument (unsigned int &idx, const IGCTensor *tensor, const unsigned int binding_point, const Window &window)
 Add the passed 1D tensor's parameters to the object's kernel's arguments starting from the index idx. More...
 
void add_2D_tensor_argument (unsigned int &idx, const IGCTensor *tensor, const unsigned int binding_point, const Window &window)
 Add the passed 2D tensor's parameters to the object's kernel's arguments starting from the index idx. More...
 
void add_3D_tensor_argument (unsigned int &idx, const IGCTensor *tensor, const unsigned int binding_point, const Window &window)
 Add the passed 3D tensor's parameters to the object's kernel's arguments starting from the index idx. More...
 
unsigned int num_arguments_per_1D_tensor () const
 Returns the number of arguments enqueued per 1D tensor object. More...
 
unsigned int num_arguments_per_2D_tensor () const
 Returns the number of arguments enqueued per 2D tensor object. More...
 
unsigned int num_arguments_per_3D_tensor () const
 Returns the number of arguments enqueued per 3D tensor object. More...
 
virtual void run (const Window &window)=0
 Enqueue the OpenGL ES shader to process the given window. More...
 
void set_lws_hint (gles::NDRange &lws_hint)
 Set the Local-Workgroup-Size hint. More...
 
void set_target (GPUTarget target)
 Set the targeted GPU architecture. More...
 
GPUTarget get_target () const
 Get the targeted GPU architecture. More...
 
- Public Member Functions inherited from IKernel
 IKernel ()
 Constructor. More...
 
virtual ~IKernel ()=default
 Destructor. More...
 
virtual bool is_parallelisable () const
 Indicates whether or not the kernel is parallelisable. More...
 
virtual BorderSize border_size () const
 The size of the border for that kernel. More...
 
const Windowwindow () const
 The maximum window the kernel can be executed on. More...
 

Detailed Description

Common interface for all the GLES kernels.

Definition at line 39 of file IGCKernel.h.

Constructor & Destructor Documentation

◆ IGCKernel()

IGCKernel ( )

Constructor.

Definition at line 64 of file IGCKernel.cpp.

References arm_compute::MIDGARD, and arm_compute::utils::cast::U.

65  : _kernel(), _lws_hint(gles::NDRange(1U, 1U, 1U)), _target(GPUTarget::MIDGARD)
66 {
67 }
Class interface for specifying NDRange values.
Definition: OpenGLES.h:53

Member Function Documentation

◆ add_1D_tensor_argument()

void add_1D_tensor_argument ( unsigned int &  idx,
const IGCTensor tensor,
const unsigned int  binding_point,
const Window window 
)

Add the passed 1D tensor's parameters to the object's kernel's arguments starting from the index idx.

Parameters
[in]idxIndex at which to start adding the tensor's arguments.Input and output tensor will have sperated index, multiple indices start from 1, single index have to be set to 0.
[in]tensorTensor to set as an argument of the object's kernel.
[in]binding_pointTensor's binding point in this kernel.
[in]windowWindow the kernel will be executed on.

Definition at line 122 of file IGCKernel.cpp.

References IKernel::window().

Referenced by GCGEMMMatrixAccumulateBiasesKernel::run(), GCDepthwiseConvolutionLayer3x3Kernel::run(), GCDirectConvolutionLayerKernel< kernel_size >::run(), GCNormalizePlanarYUVLayerKernel::run(), GCWeightsReshapeKernel::run(), GCIm2ColKernel::run(), and GCBatchNormalizationLayerKernel::run().

123 {
124  add_tensor_argument<1>(idx, tensor, binding_point, window);
125 }
const Window & window() const
The maximum window the kernel can be executed on.
Definition: IKernel.cpp:28

◆ add_2D_tensor_argument()

void add_2D_tensor_argument ( unsigned int &  idx,
const IGCTensor tensor,
const unsigned int  binding_point,
const Window window 
)

Add the passed 2D tensor's parameters to the object's kernel's arguments starting from the index idx.

Parameters
[in]idxIndex at which to start adding the tensor's arguments.Input and output tensor will have sperated index, multiple indices start from 1, single index have to be set to 0.
[in]tensorTensor to set as an argument of the object's kernel.
[in]binding_pointTensor's binding point in this kernel.
[in]windowWindow the kernel will be executed on.

Definition at line 127 of file IGCKernel.cpp.

References IKernel::window().

Referenced by IGCSimple2DKernel::run(), GCTransposeKernel::run(), GCGEMMMatrixAccumulateBiasesKernel::run(), GCGEMMMatrixAdditionKernel::run(), GCAbsoluteDifferenceKernel::run(), GCGEMMTranspose1xWKernel::run(), GCGEMMInterleave4x4Kernel::run(), GCWeightsReshapeKernel::run(), GCCol2ImKernel::run(), GCGEMMMatrixMultiplyKernel::run(), and GCIm2ColKernel::run().

128 {
129  add_tensor_argument<2>(idx, tensor, binding_point, window);
130 }
const Window & window() const
The maximum window the kernel can be executed on.
Definition: IKernel.cpp:28

◆ add_3D_tensor_argument()

void add_3D_tensor_argument ( unsigned int &  idx,
const IGCTensor tensor,
const unsigned int  binding_point,
const Window window 
)

Add the passed 3D tensor's parameters to the object's kernel's arguments starting from the index idx.

Parameters
[in]idxIndex at which to start adding the tensor's arguments.Input and output tensor will have sperated index, multiple indices start from 1, single index have to be set to 0.
[in]tensorTensor to set as an argument of the object's kernel.
[in]binding_pointTensor's binding point in this kernel.
[in]windowWindow the kernel will be executed on.

Definition at line 132 of file IGCKernel.cpp.

References IKernel::window().

Referenced by IGCSimple3DKernel::run(), GCScaleKernel::run(), GCDepthwiseConvolutionLayer3x3Kernel::run(), GCPixelWiseMultiplicationKernel::run(), GCNormalizationLayerKernel::run(), GCActivationLayerKernel::run(), GCDepthConcatenateLayerKernel::run(), GCDropoutLayerKernel::run(), GCLogits1DShiftExpSumKernel::run(), GCDirectConvolutionLayerKernel< kernel_size >::run(), GCFillBorderKernel::run(), GCPoolingLayerKernel::run(), GCArithmeticAdditionKernel::run(), GCNormalizePlanarYUVLayerKernel::run(), GCTensorShiftKernel::run(), GCWeightsReshapeKernel::run(), GCCol2ImKernel::run(), GCIm2ColKernel::run(), GCBatchNormalizationLayerKernel::run(), and GCLogits1DNormKernel::run().

133 {
134  add_tensor_argument<3>(idx, tensor, binding_point, window);
135 }
const Window & window() const
The maximum window the kernel can be executed on.
Definition: IKernel.cpp:28

◆ get_target()

GPUTarget get_target ( ) const
inline

Get the targeted GPU architecture.

Returns
The targeted GPU architecture.

Definition at line 122 of file IGCKernel.h.

References arm_compute::enqueue(), IGCKernel::kernel(), arm_compute::U, and IKernel::window().

Referenced by GCGEMMMatrixMultiplyKernel::configure().

123  {
124  return _target;
125  }

◆ kernel()

◆ num_arguments_per_1D_tensor()

unsigned int num_arguments_per_1D_tensor ( ) const

Returns the number of arguments enqueued per 1D tensor object.

Returns
The number of arguments enqueues per 1D tensor object.

Definition at line 137 of file IGCKernel.cpp.

Referenced by GCDirectConvolutionLayerKernel< kernel_size >::configure(), and GCWeightsReshapeKernel::configure().

138 {
139  return num_arguments_per_tensor<1>();
140 }

◆ num_arguments_per_2D_tensor()

unsigned int num_arguments_per_2D_tensor ( ) const

Returns the number of arguments enqueued per 2D tensor object.

Returns
The number of arguments enqueues per 2D tensor object.

Definition at line 142 of file IGCKernel.cpp.

Referenced by GCWeightsReshapeKernel::configure().

143 {
144  return num_arguments_per_tensor<2>();
145 }

◆ num_arguments_per_3D_tensor()

unsigned int num_arguments_per_3D_tensor ( ) const

◆ run()

◆ set_lws_hint()

void set_lws_hint ( gles::NDRange lws_hint)
inline

Set the Local-Workgroup-Size hint.

Note
This method should be called after the configuration of the kernel
Parameters
[in]lws_hintLocal-Workgroup-Size to use

Definition at line 104 of file IGCKernel.h.

105  {
106  _lws_hint = lws_hint;
107  }

◆ set_target()

void set_target ( GPUTarget  target)
inline

Set the targeted GPU architecture.

Parameters
[in]targetThe targeted GPU architecture

Definition at line 113 of file IGCKernel.h.

Referenced by GCGEMM::configure(), and GCConvolutionLayer::configure().

114  {
115  _target = target;
116  }

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