Compute Library
 19.08
CLPriorBoxLayer Class Reference

Basic function to run CLPriorBoxLayerKernel. More...

#include <CLPriorBoxLayer.h>

Collaboration diagram for CLPriorBoxLayer:
[legend]

Public Member Functions

 CLPriorBoxLayer ()
 Constructor. More...
 
void configure (const ICLTensor *input1, const ICLTensor *input2, ICLTensor *output, const PriorBoxLayerInfo &info)
 Set the input and output tensors. More...
 
- Public Member Functions inherited from ICLSimpleFunction
 ICLSimpleFunction ()
 Default 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...
 

Static Public Member Functions

static Status validate (const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output, const PriorBoxLayerInfo &info)
 Static function to check if given info will lead to a valid configuration of CLPriorBoxLayer. More...
 

Detailed Description

Basic function to run CLPriorBoxLayerKernel.

Definition at line 36 of file CLPriorBoxLayer.h.

Constructor & Destructor Documentation

◆ CLPriorBoxLayer()

Constructor.

Definition at line 36 of file CLPriorBoxLayer.cpp.

37  : _min(nullptr), _max(nullptr), _aspect_ratios(nullptr)
38 {
39 }

Member Function Documentation

◆ configure()

void configure ( const ICLTensor input1,
const ICLTensor input2,
ICLTensor output,
const PriorBoxLayerInfo info 
)

Set the input and output tensors.

Parameters
[in]input1First source tensor. Data types supported: F32. Data layouts supported: NCHW/NHWC.
[in]input2Second source tensor. Data types and layouts supported: same as input1
[out]outputDestination tensor. Output dimensions are [W * H * num_priors * 4, 2]. Data types and layouts supported: same as input1
[in]infoPrior box layer info.

Definition at line 41 of file CLPriorBoxLayer.cpp.

42 {
43  _min = cl::Buffer(CLScheduler::get().context(), CL_MEM_ALLOC_HOST_PTR | CL_MEM_READ_WRITE, info.min_sizes().size() * sizeof(float));
44  _aspect_ratios = cl::Buffer(CLScheduler::get().context(), CL_MEM_ALLOC_HOST_PTR | CL_MEM_READ_WRITE, info.aspect_ratios().size() * sizeof(float));
45  if(!info.max_sizes().empty())
46  {
47  _max = cl::Buffer(CLScheduler::get().context(), CL_MEM_ALLOC_HOST_PTR | CL_MEM_READ_WRITE, info.max_sizes().size() * sizeof(float));
48  }
49 
50  auto k = arm_compute::support::cpp14::make_unique<CLPriorBoxLayerKernel>();
51  k->configure(input1, input2, output, info, &_min, &_max, &_aspect_ratios);
52  _kernel = std::move(k);
53 }
static CLScheduler & get()
Access the scheduler singleton.
Definition: CLScheduler.cpp:41

References CLScheduler::get(), and arm_compute::test::validation::info.

◆ validate()

Status validate ( const ITensorInfo input1,
const ITensorInfo input2,
const ITensorInfo output,
const PriorBoxLayerInfo info 
)
static

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

Parameters
[in]input1First source tensor info. Data types supported: F32. Data layouts supported: NCHW/NHWC.
[in]input2Second source tensor info. Data types and layouts supported: same as input1
[in]outputDestination tensor info. Output dimensions are [W * H * num_priors * 4, 2]. Data types and layouts supported: same as input1
[in]infoPrior box layer info.
Returns
a status

Definition at line 55 of file CLPriorBoxLayer.cpp.

56 {
57  return CLPriorBoxLayerKernel::validate(input1, input2, output, info);
58 }
static Status validate(const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output, const PriorBoxLayerInfo &info)
Static function to check if given info will lead to a valid configuration of CLPriorBoxLayerKernel.

References arm_compute::test::validation::info, and CLPriorBoxLayerKernel::validate().


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