Compute Library
 19.08
GCNormalizePlanarYUVLayer Class Reference

Basic function to run GCNormalizePlanarYUVLayerKernel. More...

#include <GCNormalizePlanarYUVLayer.h>

Collaboration diagram for GCNormalizePlanarYUVLayer:
[legend]

Public Member Functions

 GCNormalizePlanarYUVLayer ()
 Default constructor. More...
 
void configure (const IGCTensor *input, IGCTensor *output, const IGCTensor *mean, const IGCTensor *std)
 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...
 

Static Public Member Functions

static Status validate (const ITensorInfo *input, const ITensorInfo *output, const ITensorInfo *mean, const ITensorInfo *std)
 Static function to check if given info will lead to a valid configuration of CLNormalizePlanarYUVLayer. More...
 

Detailed Description

Basic function to run GCNormalizePlanarYUVLayerKernel.

Note
The function simulates a NormalizePlanarYUV layer.

Definition at line 40 of file GCNormalizePlanarYUVLayer.h.

Constructor & Destructor Documentation

◆ GCNormalizePlanarYUVLayer()

Default constructor.

Definition at line 35 of file GCNormalizePlanarYUVLayer.cpp.

36  : _norm_kernel()
37 {
38 }

Member Function Documentation

◆ configure()

void configure ( const IGCTensor input,
IGCTensor output,
const IGCTensor mean,
const IGCTensor std 
)

Set the input and output tensors.

Parameters
[in]inputSource tensor. 3 lower dimensions represent a single input with dimensions [width, height, channels]. Data types supported: F16.
[out]outputDestination tensor. Data type supported: same as input
[in]meanMean values tensor. 1 dimension with size equal to the number of input channels. Data types supported: same as input
[in]stdStandard deviation values tensor. 1 dimension with size equal to the number of input channels. Data types supported: same as input

Definition at line 40 of file GCNormalizePlanarYUVLayer.cpp.

41 {
42  _norm_kernel.configure(input, output, mean, std);
43 }
void configure(const IGCTensor *input, IGCTensor *output, const IGCTensor *mean, const IGCTensor *std)
Set the input and output tensors.

References GCNormalizePlanarYUVLayerKernel::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 51 of file GCNormalizePlanarYUVLayer.cpp.

52 {
53  GCScheduler::get().dispatch(_norm_kernel, true);
54 }
void dispatch(IGCKernel &kernel, bool flush=true)
Schedule the execution of the passed kernel if possible.
Definition: GCScheduler.cpp:69
static GCScheduler & get()
Access the scheduler singleton.
Definition: GCScheduler.cpp:62

References GCScheduler::dispatch(), and GCScheduler::get().

◆ validate()

Status validate ( const ITensorInfo input,
const ITensorInfo output,
const ITensorInfo mean,
const ITensorInfo std 
)
static

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

Parameters
[in]inputSource tensor info. 3 lower dimensions represent a single input with dimensions [width, height, channels]. Data types supported: F16/F32.
[out]outputDestination tensor info. Data type supported: same as input
[in]meanMean values tensor info. 1 dimension with size equal to the number of input channels. Data types supported: same as input
[in]stdStandard deviation values tensor info. 1 dimension with size equal to the number of input channels. Data types supported: same as input
Returns
a status

Definition at line 45 of file GCNormalizePlanarYUVLayer.cpp.

47 {
48  return GCNormalizePlanarYUVLayerKernel::validate(input, output, mean, std);
49 }
static Status validate(const ITensorInfo *input, const ITensorInfo *output, const ITensorInfo *mean, const ITensorInfo *std)
Static function to check if given info will lead to a valid configuration of GCNormalizePlanarYUVLaye...

References GCNormalizePlanarYUVLayerKernel::validate().


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