Compute Library
 22.05
CLROIPoolingLayer Class Reference

Basic function to run CLROIPoolingLayerKernel. More...

#include <CLROIPoolingLayer.h>

Collaboration diagram for CLROIPoolingLayer:
[legend]

Public Member Functions

void configure (const ICLTensor *input, const ICLTensor *rois, ICLTensor *output, const ROIPoolingLayerInfo &pool_info)
 Set the input and output tensors. More...
 
void configure (const CLCompileContext &compile_context, const ICLTensor *input, const ICLTensor *rois, const ICLTensor *output, const ROIPoolingLayerInfo &pool_info)
 Set the input and output tensors. More...
 
- Public Member Functions inherited from ICLSimpleFunction
 ICLSimpleFunction (CLRuntimeContext *ctx=nullptr)
 Constructor. More...
 
 ICLSimpleFunction (const ICLSimpleFunction &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
 ICLSimpleFunction (ICLSimpleFunction &&)=default
 Default move constructor. More...
 
ICLSimpleFunctionoperator= (const ICLSimpleFunction &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
ICLSimpleFunctionoperator= (ICLSimpleFunction &&)=default
 Default move assignment operator. More...
 
 ~ICLSimpleFunction ()
 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...
 

Static Public Member Functions

static Status validate (const ITensorInfo *input, const ITensorInfo *rois, ITensorInfo *output, const ROIPoolingLayerInfo &pool_info)
 Static function to check if given info will lead to a valid configuration of CLROIPoolingLayer. More...
 

Detailed Description

Basic function to run CLROIPoolingLayerKernel.

This function calls the following OpenCL kernels:

  1. CLROIPoolingLayerKernel

Definition at line 43 of file CLROIPoolingLayer.h.

Member Function Documentation

◆ configure() [1/2]

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

Set the input and output tensors.

Valid data layouts:

  • All

Valid data type configurations:

src0 src1 dst
F16 U16 F16
F32 U16 F32
QASYMM8 U16 QASYMM8
Parameters
[in]inputSource tensor. Data types supported: F16/F32/QASYMM8
[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 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 CLROIPoolingLayer.cpp.

References CLKernelLibrary::get().

38 {
39  configure(CLKernelLibrary::get().get_compile_context(), input, rois, output, pool_info);
40 }
static CLKernelLibrary & get()
Access the KernelLibrary singleton.
void configure(const ICLTensor *input, const ICLTensor *rois, ICLTensor *output, const ROIPoolingLayerInfo &pool_info)
Set the input and output tensors.

◆ configure() [2/2]

void configure ( const CLCompileContext compile_context,
const ICLTensor input,
const ICLTensor rois,
const ICLTensor output,
const ROIPoolingLayerInfo pool_info 
)

Set the input and output tensors.

Parameters
[in]compile_contextThe compile context to be used.
[in]inputSource tensor. Data types supported: F16/F32/QASYMM8
[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 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 42 of file CLROIPoolingLayer.cpp.

References ARM_COMPUTE_LOG_PARAMS, and arm_compute::test::validation::k.

43 {
44  ARM_COMPUTE_LOG_PARAMS(input, rois, output, pool_info);
45 
46  // Configure ROI pooling kernel
47  auto k = std::make_unique<CLROIPoolingLayerKernel>();
48  k->configure(compile_context, input, rois, output, pool_info);
49  _kernel = std::move(k);
50 }
#define ARM_COMPUTE_LOG_PARAMS(...)

◆ validate()

Status validate ( const ITensorInfo input,
const ITensorInfo rois,
ITensorInfo output,
const ROIPoolingLayerInfo pool_info 
)
static

Static function to check if given info will lead to a valid configuration of CLROIPoolingLayer.

Parameters
[in]inputSource tensor info. Data types supported: QASYMM8/F16/F32.
[in]roisROIs tensor info. Data types supported: U16
[in]outputDestination tensor info. 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 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.
Returns
a Status

Definition at line 32 of file CLROIPoolingLayer.cpp.

References CLROIPoolingLayerKernel::validate().

Referenced by arm_compute::test::validation::DATA_TEST_CASE().

33 {
34  return CLROIPoolingLayerKernel::validate(input, rois, output, pool_info);
35 }
static Status validate(const ITensorInfo *input, const ITensorInfo *rois, const ITensorInfo *output, const ROIPoolingLayerInfo &pool_info)
Static Validate function to check inputs will lead to valid configuration of CLROIPoolingLayer.

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