Compute Library
 21.02
CLConvolutionRectangle Class Reference

Basic function to execute non-square convolution. More...

#include <CLConvolution.h>

Collaboration diagram for CLConvolutionRectangle:
[legend]

Public Member Functions

void configure (ICLTensor *input, ICLTensor *output, const int16_t *conv, uint32_t rows, uint32_t cols, uint32_t scale, BorderMode border_mode, uint8_t constant_border_value=0)
 Initialize the function's source, destination, conv and border_mode. More...
 
void configure (const CLCompileContext &compile_context, ICLTensor *input, ICLTensor *output, const int16_t *conv, uint32_t rows, uint32_t cols, uint32_t scale, BorderMode border_mode, uint8_t constant_border_value=0)
 Initialize the function's source, destination, conv and border_mode. More...
 
- Public Member Functions inherited from ICLSimpleFunction
 ICLSimpleFunction (CLRuntimeContext *ctx=nullptr)
 Constructor. More...
 
 ICLSimpleFunction (const ICLSimpleFunction &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
 ICLSimpleFunction (ICLSimpleFunction &&)=default
 Default move constructor. More...
 
ICLSimpleFunctionoperator= (const ICLSimpleFunction &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
ICLSimpleFunctionoperator= (ICLSimpleFunction &&)=default
 Default move assignment operator. More...
 
 ~ICLSimpleFunction ()
 Default destructor. More...
 
void run () override final
 Run the kernels contained in the function. More...
 
- Public Member Functions inherited from IFunction
virtual ~IFunction ()=default
 Destructor. More...
 
virtual void prepare ()
 Prepare the function for executing. More...
 

Detailed Description

Basic function to execute non-square convolution.

This function calls the following CL kernels:

  1. CLFillBorderKernel (executed if border_mode == CONSTANT or border_mode == REPLICATE)
  2. CLConvolutionRectangleKernel or
Note
Convolution rectangle should have dimensions of 3, 5, 7, 9
Deprecated:
This function is deprecated and is intended to be removed in 21.05 release

Definition at line 159 of file CLConvolution.h.

Member Function Documentation

◆ configure() [1/2]

void configure ( ICLTensor input,
ICLTensor output,
const int16_t *  conv,
uint32_t  rows,
uint32_t  cols,
uint32_t  scale,
BorderMode  border_mode,
uint8_t  constant_border_value = 0 
)

Initialize the function's source, destination, conv and border_mode.

Parameters
[in,out]inputSource tensor. Data types supported: U8. (Written to only for border_mode != UNDEFINED)
[out]outputDestination tensor, Data types supported: U8 or S16.
[in]convMatrix_size x matrix_size S16 coefficients structured as a row-major 2D array in a linear buffer.
[in]rowsRows of convolution kernel.
[in]colsColumns of convolution kernel.
[in]scaleScale of the convolution matrix. If 0 is passed, it will be set to the sum of the coefficients of the convolution or 1 if they add up to 0.
[in]border_modeStrategy to use for borders.
[in]constant_border_value(Optional) Constant value to use for borders if border_mode is set to CONSTANT.

Definition at line 131 of file CLConvolution.cpp.

References CLConvolutionSquare< matrix_size >::configure(), and CLKernelLibrary::get().

132 {
133  configure(CLKernelLibrary::get().get_compile_context(), input, output, conv, rows, cols, scale, border_mode, constant_border_value);
134 }
static CLKernelLibrary & get()
Access the KernelLibrary singleton.
void configure(ICLTensor *input, ICLTensor *output, const int16_t *conv, uint32_t rows, uint32_t cols, uint32_t scale, BorderMode border_mode, uint8_t constant_border_value=0)
Initialize the function&#39;s source, destination, conv and border_mode.

◆ configure() [2/2]

void configure ( const CLCompileContext compile_context,
ICLTensor input,
ICLTensor output,
const int16_t *  conv,
uint32_t  rows,
uint32_t  cols,
uint32_t  scale,
BorderMode  border_mode,
uint8_t  constant_border_value = 0 
)

Initialize the function's source, destination, conv and border_mode.

Parameters
[in]compile_contextThe compile context to be used.
[in,out]inputSource tensor. Data types supported: U8. (Written to only for border_mode != UNDEFINED)
[out]outputDestination tensor, Data types supported: U8 or S16.
[in]convMatrix_size x matrix_size S16 coefficients structured as a row-major 2D array in a linear buffer.
[in]rowsRows of convolution kernel.
[in]colsColumns of convolution kernel.
[in]scaleScale of the convolution matrix. If 0 is passed, it will be set to the sum of the coefficients of the convolution or 1 if they add up to 0.
[in]border_modeStrategy to use for borders.
[in]constant_border_value(Optional) Constant value to use for borders if border_mode is set to CONSTANT.

Definition at line 136 of file CLConvolution.cpp.

References arm_compute::CONSTANT, and arm_compute::UNDEFINED.

138 {
139  border_mode = (border_mode == BorderMode::UNDEFINED) ? BorderMode::CONSTANT : border_mode;
140  auto k = std::make_unique<CLConvolutionRectangleKernel>();
141  k->configure(compile_context, input, output, conv, rows, cols, scale, false);
142  _kernel = std::move(k);
143  _border_handler->configure(compile_context, input, _kernel->border_size(), border_mode, PixelValue(constant_border_value));
144 }
Class describing the value of a pixel for any image format.
Definition: PixelValue.h:34
Borders are left undefined.

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