Compute Library
 21.05
INESimpleFunctionNoBorder Class Reference

Basic interface for functions which have a single CPU kernel and no border. More...

#include <INESimpleFunctionNoBorder.h>

Collaboration diagram for INESimpleFunctionNoBorder:
[legend]

Public Member Functions

 INESimpleFunctionNoBorder (IRuntimeContext *ctx=nullptr)
 Constructor. More...
 
 INESimpleFunctionNoBorder (const INESimpleFunctionNoBorder &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
 INESimpleFunctionNoBorder (INESimpleFunctionNoBorder &&)=default
 Default move constructor. More...
 
INESimpleFunctionNoBorderoperator= (const INESimpleFunctionNoBorder &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
INESimpleFunctionNoBorderoperator= (INESimpleFunctionNoBorder &&)=default
 Default move assignment operator. More...
 
 ~INESimpleFunctionNoBorder ()
 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 CPU kernel and no border.

Definition at line 37 of file INESimpleFunctionNoBorder.h.

Constructor & Destructor Documentation

◆ INESimpleFunctionNoBorder() [1/3]

Constructor.

Parameters
[in]ctxRuntime context to be used by the function

Definition at line 35 of file INESimpleFunctionNoBorder.cpp.

36  : _kernel(),
37  _ctx(ctx)
38 {
39 }

◆ INESimpleFunctionNoBorder() [2/3]

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

◆ INESimpleFunctionNoBorder() [3/3]

Default move constructor.

◆ ~INESimpleFunctionNoBorder()

Default destructor.

Member Function Documentation

◆ operator=() [1/2]

INESimpleFunctionNoBorder& operator= ( const INESimpleFunctionNoBorder )
delete

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

◆ operator=() [2/2]

Default move assignment operator.

◆ run()

void run ( )
finaloverridevirtual

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.
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 INESimpleFunctionNoBorder.cpp.

42 {
43  utils::schedule_kernel_on_ctx(_ctx, _kernel.get(), Window::DimY);
44 }
void schedule_kernel_on_ctx(IRuntimeContext *ctx, ICPPKernel *kernel, const IScheduler::Hints &hints)
Schedules a kernel using the context if not nullptr else uses the legacy scheduling flow.
Definition: Utils.cpp:55
static constexpr size_t DimY
Alias for dimension 1 also known as Y dimension.
Definition: Window.h:45

References Window::DimY, and arm_compute::utils::schedule_kernel_on_ctx().

Referenced by main(), NEFFTConvolutionLayer::prepare(), NEDeconvolutionLayer::prepare(), NEGenerateProposalsLayer::run(), NELSTMLayerQuantized::run(), NELSTMLayer::run(), and NEQLSTMLayer::run().


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