Compute Library  18.05
CLSobel7x7 Class Reference

Basic function to execute sobel 7x7 filter. More...

#include <CLSobel7x7.h>

Collaboration diagram for CLSobel7x7:
[legend]

Public Member Functions

 CLSobel7x7 (std::shared_ptr< IMemoryManager > memory_manager=nullptr)
 Default Constructor. More...
 
void configure (ICLTensor *input, ICLTensor *output_x, ICLTensor *output_y, BorderMode border_mode, uint8_t constant_border_value=0)
 Initialise the function's source, destinations and border mode. More...
 
void run () override
 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 sobel 7x7 filter.

This function calls the following OpenCL kernels:

  1. CLFillBorderKernel (executed if border_mode == CONSTANT or border_mode == REPLICATE)
  2. CLSobel7x7HorKernel
  3. CLSobel7x7VertKernel

Definition at line 49 of file CLSobel7x7.h.

Constructor & Destructor Documentation

CLSobel7x7 ( std::shared_ptr< IMemoryManager memory_manager = nullptr)

Default Constructor.

Parameters
[in]memory_manager(Optional) Memory manager.

Member Function Documentation

void configure ( ICLTensor input,
ICLTensor output_x,
ICLTensor output_y,
BorderMode  border_mode,
uint8_t  constant_border_value = 0 
)

Initialise the function's source, destinations and border mode.

Note
At least one of output_x or output_y must be not NULL.
Parameters
[in,out]inputSource tensor. Data types supported: U8. (Written to only for border_mode != UNDEFINED)
[out]output_x(optional) Destination for the Sobel 7x7 convolution along the X axis. Data types supported: S32.
[out]output_y(optional) Destination for the Sobel 7x7 convolution along the Y axis. Data types supported: S32.
[in]border_modeBorder mode to use for the convolution.
[in]constant_border_value(Optional) Constant value to use for borders if border_mode is set to CONSTANT.
void run ( )
overridevirtual

Run the kernels contained in the function.

For NEON kernels:

  • Multi-threading is used for the kernels which are parallelisable.
  • By default std::thread::hardware_concurrency() threads are used.
Note
CPPScheduler::set_num_threads() can be used to manually set the number of threads

For OpenCL kernels:

  • All the kernels are enqueued on the queue associated with CLScheduler.
  • The queue is then flushed.
Note
The function will not block until the kernels are executed. It is the user's responsibility to wait.
Will call prepare() on first run if hasn't been done

Implements IFunction.


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