Compute Library
ICPPSimpleFunction Class Reference

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

#include <ICPPSimpleFunction.h>

Collaboration diagram for ICPPSimpleFunction:

Public Member Functions

 ICPPSimpleFunction ()
 Constructor. 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 CPP kernel.

Definition at line 35 of file ICPPSimpleFunction.h.

Constructor & Destructor Documentation

◆ ICPPSimpleFunction()


Definition at line 30 of file ICPPSimpleFunction.cpp.

31  : _kernel()
32 {
33 }

Member Function Documentation

◆ run()

void run ( )

Run the kernels contained in the function.

For CPU kernels:

  • Multi-threading is used for the kernels which are parallelisable.
  • By default std::thread::hardware_concurrency() threads are used.
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.
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 35 of file ICPPSimpleFunction.cpp.

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

Referenced by CPPDetectionPostProcessLayer::run(), NEDeconvolutionLayer::run(), and arm_compute::test::validation::TEST_CASE().

36 {
37  Scheduler::get().schedule(_kernel.get(), Window::DimY);
38 }
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 IScheduler & get()
Access the scheduler singleton.
Definition: Scheduler.cpp:94

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