Compute Library
 21.02
INESimpleFunction Class Reference

Basic interface for functions which have a single Neon kernel. More...

#include <INESimpleFunction.h>

Collaboration diagram for INESimpleFunction:
[legend]

Public Member Functions

 INESimpleFunction ()
 Constructor. More...
 
 INESimpleFunction (const INESimpleFunction &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
 INESimpleFunction (INESimpleFunction &&)=default
 Default move constructor. More...
 
INESimpleFunctionoperator= (const INESimpleFunction &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
INESimpleFunctionoperator= (INESimpleFunction &&)=default
 Default move assignment operator. More...
 
 ~INESimpleFunction ()
 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 interface for functions which have a single Neon kernel.

Definition at line 37 of file INESimpleFunction.h.

Constructor & Destructor Documentation

◆ INESimpleFunction() [1/3]

Constructor.

Definition at line 35 of file INESimpleFunction.cpp.

36  : _kernel(),
37  _border_handler()
38 {
39 }

◆ INESimpleFunction() [2/3]

INESimpleFunction ( const INESimpleFunction )
delete

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

◆ INESimpleFunction() [3/3]

Default move constructor.

◆ ~INESimpleFunction()

~INESimpleFunction ( )
default

Default destructor.

Member Function Documentation

◆ operator=() [1/2]

INESimpleFunction& operator= ( const INESimpleFunction )
delete

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

◆ operator=() [2/2]

INESimpleFunction& operator= ( INESimpleFunction &&  )
default

Default move assignment operator.

◆ run()

void run ( )
finaloverridevirtual

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 41 of file INESimpleFunction.cpp.

References Window::DimY, Window::DimZ, Scheduler::get(), and IScheduler::schedule().

Referenced by NEHarrisCorners::run().

42 {
43  NEScheduler::get().schedule(_border_handler.get(), Window::DimZ);
44  NEScheduler::get().schedule(_kernel.get(), Window::DimY);
45 }
static constexpr size_t DimY
Alias for dimension 1 also known as Y dimension.
Definition: Window.h:45
virtual void schedule(ICPPKernel *kernel, const Hints &hints)=0
Runs the kernel in the same thread as the caller synchronously.
static constexpr size_t DimZ
Alias for dimension 2 also known as Z dimension.
Definition: Window.h:47
static IScheduler & get()
Access the scheduler singleton.
Definition: Scheduler.cpp:94

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