Compute Library
 19.08
NEROIPoolingLayer Class Reference

Basic function to run NEROIPoolingLayerKernel. More...

#include <NEROIPoolingLayer.h>

Collaboration diagram for NEROIPoolingLayer:
[legend]

Public Member Functions

 NEROIPoolingLayer ()
 Constructor. 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 42 of file NEROIPoolingLayer.h.

Constructor & Destructor Documentation

◆ NEROIPoolingLayer()

Constructor.

Definition at line 32 of file NEROIPoolingLayer.cpp.

33  : _roi_kernel()
34 {
35 }

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

38 {
39  _roi_kernel.configure(input, rois, output, pool_info);
40 }
void configure(const ITensor *input, const ITensor *rois, ITensor *output, const ROIPoolingLayerInfo &pool_info)
Set the input and output tensors.

References NEROIPoolingLayerKernel::configure().

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

43 {
44  NEScheduler::get().schedule(&_roi_kernel, Window::DimX);
45 }
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:96

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


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