Compute Library
 21.02
NEROIPoolingLayer Class Reference

Basic function to run NEROIPoolingLayerKernel. More...

#include <NEROIPoolingLayer.h>

Collaboration diagram for NEROIPoolingLayer:
[legend]

Public Member Functions

 NEROIPoolingLayer ()
 Constructor. More...
 
 NEROIPoolingLayer (const NEROIPoolingLayer &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
NEROIPoolingLayeroperator= (const NEROIPoolingLayer &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
 NEROIPoolingLayer (NEROIPoolingLayer &&)=delete
 Prevent instances of this class from being moved (As this class contains non movable objects) More...
 
NEROIPoolingLayeroperator= (NEROIPoolingLayer &&)=delete
 Prevent instances of this class from being moved (As this class contains non movable objects) More...
 
 ~NEROIPoolingLayer ()
 Default destructor. More...
 
void configure (const ITensor *input, const ITensor *rois, ITensor *output, const ROIPoolingLayerInfo &pool_info)
 Set the input and output tensors. 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 run NEROIPoolingLayerKernel.

This function calls the following Neon kernels:

  1. NEROIPoolingLayerKernel

Definition at line 44 of file NEROIPoolingLayer.h.

Constructor & Destructor Documentation

◆ NEROIPoolingLayer() [1/3]

Constructor.

Definition at line 34 of file NEROIPoolingLayer.cpp.

35  : _roi_kernel()
36 {
37 }

◆ NEROIPoolingLayer() [2/3]

NEROIPoolingLayer ( const NEROIPoolingLayer )
delete

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

◆ NEROIPoolingLayer() [3/3]

Prevent instances of this class from being moved (As this class contains non movable objects)

◆ ~NEROIPoolingLayer()

~NEROIPoolingLayer ( )
default

Default destructor.

Member Function Documentation

◆ configure()

void configure ( const ITensor input,
const ITensor rois,
ITensor output,
const ROIPoolingLayerInfo pool_info 
)

Set the input and output tensors.

Parameters
[in]inputSource tensor. Data types supported: F32.
[in]roisROIs tensor, it is a 2D tensor of size [5, N] (where N is the number of ROIs) containing top left and bottom right corner as coordinate of an image and batch_id of ROI [ batch_id, x1, y1, x2, y2 ]. Data types supported: U16
[out]outputDestination tensor. Data types supported: Same as input.
[in]pool_infoContains pooling operation information described in ROIPoolingLayerInfo.
Note
The x and y dimensions of output tensor must be the same as that specified by pool_info 's pooled width and pooled height.
The z dimensions of output tensor and input tensor must be the same.
The fourth dimension of output tensor must be the same as the number of elements in rois array.

Definition at line 39 of file NEROIPoolingLayer.cpp.

40 {
41  _roi_kernel = std::make_unique<NEROIPoolingLayerKernel>();
42  _roi_kernel->configure(input, rois, output, pool_info);
43 }

◆ operator=() [1/2]

NEROIPoolingLayer& operator= ( const NEROIPoolingLayer )
delete

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

◆ operator=() [2/2]

NEROIPoolingLayer& operator= ( NEROIPoolingLayer &&  )
delete

Prevent instances of this class from being moved (As this class contains non movable objects)

◆ 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 45 of file NEROIPoolingLayer.cpp.

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

46 {
47  NEScheduler::get().schedule(_roi_kernel.get(), Window::DimX);
48 }
static constexpr size_t DimX
Alias for dimension 0 also known as X dimension.
Definition: Window.h:43
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: