Compute Library
 21.02
CLIntegralImage Class Reference

Basic function to execute integral image. More...

#include <CLIntegralImage.h>

Collaboration diagram for CLIntegralImage:
[legend]

Public Member Functions

 CLIntegralImage ()
 Default Constructor. More...
 
 CLIntegralImage (const CLIntegralImage &)=delete
 Prevent instances of this class from being copied. More...
 
CLIntegralImageoperator= (const CLIntegralImage &)=delete
 Prevent instances of this class from being copied. More...
 
 ~CLIntegralImage ()
 Default destructor. More...
 
void configure (const ICLTensor *input, ICLTensor *output)
 Initialise the function's source, destinations and border mode. More...
 
void configure (const CLCompileContext &compile_context, const ICLTensor *input, ICLTensor *output)
 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 integral image.

This function calls the following OpenCL kernels:

  1. CLIntegralImageHorKernel
  2. CLIntegralImageVertKernel
Deprecated:
This function is deprecated and is intended to be removed in 21.05 release

Definition at line 46 of file CLIntegralImage.h.

Constructor & Destructor Documentation

◆ CLIntegralImage() [1/2]

Default Constructor.

Definition at line 31 of file CLIntegralImage.cpp.

References CLIntegralImage::~CLIntegralImage().

32  : _integral_hor(std::make_unique<CLIntegralImageHorKernel>()),
33  _integral_vert(std::make_unique<CLIntegralImageVertKernel>())
34 {
35 }

◆ CLIntegralImage() [2/2]

CLIntegralImage ( const CLIntegralImage )
delete

Prevent instances of this class from being copied.

◆ ~CLIntegralImage()

~CLIntegralImage ( )
default

Default destructor.

Referenced by CLIntegralImage::CLIntegralImage().

Member Function Documentation

◆ configure() [1/2]

void configure ( const ICLTensor input,
ICLTensor output 
)

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

Parameters
[in]inputSource tensor. Data types supported: U8.
[out]outputDestination tensor, Data types supported: U32.

Definition at line 39 of file CLIntegralImage.cpp.

References CLKernelLibrary::get().

40 {
41  configure(CLKernelLibrary::get().get_compile_context(), input, output);
42 }
void configure(const ICLTensor *input, ICLTensor *output)
Initialise the function&#39;s source, destinations and border mode.
static CLKernelLibrary & get()
Access the KernelLibrary singleton.

◆ configure() [2/2]

void configure ( const CLCompileContext compile_context,
const ICLTensor input,
ICLTensor output 
)

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

Parameters
[in]compile_contextThe compile context to be used.
[in]inputSource tensor. Data types supported: U8.
[out]outputDestination tensor, Data types supported: U32.

Definition at line 44 of file CLIntegralImage.cpp.

45 {
46  _integral_hor->configure(compile_context, input, output);
47  _integral_vert->configure(compile_context, output);
48 }

◆ operator=()

CLIntegralImage& operator= ( const CLIntegralImage )
delete

Prevent instances of this class from being copied.

◆ run()

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.

Definition at line 50 of file CLIntegralImage.cpp.

References CLScheduler::enqueue(), and CLScheduler::get().

51 {
52  CLScheduler::get().enqueue(*_integral_hor, false);
53  CLScheduler::get().enqueue(*_integral_vert);
54 }
static CLScheduler & get()
Access the scheduler singleton.
void enqueue(ICLKernel &kernel, bool flush=true)
Schedule the execution of the passed kernel if possible.

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