Compute Library
 21.02
CLHistogram Class Reference

Basic function to execute histogram. More...

#include <CLHistogram.h>

Collaboration diagram for CLHistogram:
[legend]

Public Member Functions

 CLHistogram ()
 
 CLHistogram (const CLHistogram &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
const CLHistogramoperator= (const CLHistogram &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
void configure (const ICLImage *input, ICLDistribution1D *output)
 Initialize the function. More...
 
void configure (const CLCompileContext &compile_context, const ICLImage *input, ICLDistribution1D *output)
 Initialize the function. 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 histogram.

This function calls the following OpenCL kernels:

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

Definition at line 43 of file CLHistogram.h.

Constructor & Destructor Documentation

◆ CLHistogram() [1/2]

Definition at line 30 of file CLHistogram.cpp.

31  : _kernel(), _kernel_border()
32 {
33 }

◆ CLHistogram() [2/2]

CLHistogram ( const CLHistogram )
delete

Prevent instances of this class from being copied (As this class contains pointers)

Member Function Documentation

◆ configure() [1/2]

void configure ( const ICLImage input,
ICLDistribution1D output 
)

Initialize the function.

Parameters
[in]inputSource image. Data types supported: U8
[out]outputOutput distribution.

Definition at line 35 of file CLHistogram.cpp.

References CLKernelLibrary::get().

36 {
37  configure(CLKernelLibrary::get().get_compile_context(), input, output);
38 }
void configure(const ICLImage *input, ICLDistribution1D *output)
Initialize the function.
Definition: CLHistogram.cpp:35
static CLKernelLibrary & get()
Access the KernelLibrary singleton.

◆ configure() [2/2]

void configure ( const CLCompileContext compile_context,
const ICLImage input,
ICLDistribution1D output 
)

Initialize the function.

Parameters
[in]compile_contextThe compile context to be used.
[in]inputSource image. Data types supported: U8
[out]outputOutput distribution.

Definition at line 40 of file CLHistogram.cpp.

References CLHistogramKernel::configure(), and CLHistogramBorderKernel::configure().

41 {
42  _kernel.configure(compile_context, input, output);
43  _kernel_border.configure(compile_context, input, output);
44 }
void configure(const ICLImage *input, ICLDistribution1D *output)
Initialise the kernel&#39;s input, output and border mode.
void configure(const ICLImage *input, ICLDistribution1D *output)
Initialise the kernel&#39;s input, output and border mode.

◆ operator=()

const CLHistogram& operator= ( const CLHistogram )
delete

Prevent instances of this class from being copied (As this class contains pointers)

◆ 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 46 of file CLHistogram.cpp.

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

47 {
48  CLScheduler::get().enqueue(_kernel, false);
49  CLScheduler::get().enqueue(_kernel_border);
50 }
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: