VXLIB User Guide

Introduction

Kernel for computing bitwise or of two input vector data.

Performs bitwise or between two images. The following datatype combinations are supported:

Case Input0 Input1 Output
0 uint8_t uint8_t uint8_t
1 int8_t int8_t int8_t
2 uint16_t uint16_t uint16_t
3 int16_t int16_t int16_t
Method
 dst(x,y) = src0(x,y) | src1(x,y)

OpenVX Function Reference Page : https://www.khronos.org/registry/vx/specs/1.1/html/d2/d5d/group__group__vision__function__or.html

Data Structures

struct  VXLIB_or_InitArgs
 Structure containing the parameters to initialize the kernel. More...
 

Functions

int32_t VXLIB_or_getHandleSize (VXLIB_or_InitArgs *pKerInitArgs)
 This is a query function to calculate the size of internal handle. More...
 
VXLIB_STATUS VXLIB_or_init (VXLIB_kernelHandle handle, VXLIB_bufParams2D_t *bufParamsIn0, VXLIB_bufParams2D_t *bufParamsIn1, VXLIB_bufParams2D_t *bufParamsOut, const VXLIB_or_InitArgs *pKerInitArgs)
 This function should be called before the VXLIB_or_exec function is called. This function takes care of any one-time operations such as setting up the configuration of required hardware resources such as the streaming engine. The results of these operations are stored in the handle. More...
 
VXLIB_STATUS VXLIB_or_init_checkParams (VXLIB_kernelHandle handle, const VXLIB_bufParams2D_t *bufParamsIn0, const VXLIB_bufParams2D_t *bufParamsIn1, const VXLIB_bufParams2D_t *bufParamsOut, const VXLIB_or_InitArgs *pKerInitArgs)
 This function checks the validity of the parameters passed to VXLIB_or_init function. This function is called with the same parameters as the VXLIB_or_init, and this function must be called before the VXLIB_or_init is called. More...
 
VXLIB_STATUS VXLIB_or_exec_checkParams (VXLIB_kernelHandle handle, const void *restrict pIn0, const void *restrict pIn1, const void *restrict pOut)
 This function checks the validity of the parameters passed to VXLIB_or_exec function. This function is called with the same parameters as the VXLIB_or_exec, and this function must be called before the VXLIB_or_exec is called. More...
 
VXLIB_STATUS VXLIB_or_exec (VXLIB_kernelHandle handle, void *restrict pIn0, void *restrict pIn1, void *restrict pOut)
 This function is the main kernel compute function. More...
 
void VXLIB_or_perfEst (VXLIB_kernelHandle handle, size_t *archCycles, size_t *estCycles)
 This function estimates the archCycles and estCycles. More...
 

Function Documentation

◆ VXLIB_or_getHandleSize()

int32_t VXLIB_or_getHandleSize ( VXLIB_or_InitArgs pKerInitArgs)

This is a query function to calculate the size of internal handle.

Parameters
[in]pKerInitArgs: Pointer to structure holding init parameters
Returns
Size of the buffer in bytes
Remarks
Application is expected to allocate buffer of the requested size and provide it as input to other functions requiring it.

Definition at line 50 of file VXLIB_or.cpp.

◆ VXLIB_or_init()

VXLIB_STATUS VXLIB_or_init ( VXLIB_kernelHandle  handle,
VXLIB_bufParams2D_t bufParamsIn0,
VXLIB_bufParams2D_t bufParamsIn1,
VXLIB_bufParams2D_t bufParamsOut,
const VXLIB_or_InitArgs pKerInitArgs 
)

This function should be called before the VXLIB_or_exec function is called. This function takes care of any one-time operations such as setting up the configuration of required hardware resources such as the streaming engine. The results of these operations are stored in the handle.

Parameters
[in]handle: Active handle to the kernel
[in]bufParamsIn0: Pointer to the structure containing dimensional information of input image 0
[in]bufParamsIn1: Pointer to the structure containing dimensional information of input image 1
[out]bufParamsOut: Pointer to the structure containing dimensional information of output image
[in]pKerInitArgs: Pointer to the structure holding init parameters
Returns
Status value indicating success or failure. Refer to VXLIB_STATUS.
Remarks
Application is expected to provide a valid handle.

Definition at line 143 of file VXLIB_or.cpp.

◆ VXLIB_or_init_checkParams()

VXLIB_STATUS VXLIB_or_init_checkParams ( VXLIB_kernelHandle  handle,
const VXLIB_bufParams2D_t bufParamsIn0,
const VXLIB_bufParams2D_t bufParamsIn1,
const VXLIB_bufParams2D_t bufParamsOut,
const VXLIB_or_InitArgs pKerInitArgs 
)

This function checks the validity of the parameters passed to VXLIB_or_init function. This function is called with the same parameters as the VXLIB_or_init, and this function must be called before the VXLIB_or_init is called.

Parameters
[in]handle: Active handle to the kernel
[in]bufParamsIn0: Pointer to the structure containing dimensional information of input image 0
[in]bufParamsIn1: Pointer to the structure containing dimensional information of input image 1
[out]bufParamsOut: Pointer to the structure containing dimensional information of output image
[in]pKerInitArgs: Pointer to the structure holding init parameters
Returns
Status value indicating success or failure. Refer to VXLIB_STATUS.
Remarks
None

Definition at line 64 of file VXLIB_or.cpp.

◆ VXLIB_or_exec_checkParams()

VXLIB_STATUS VXLIB_or_exec_checkParams ( VXLIB_kernelHandle  handle,
const void *restrict  pIn0,
const void *restrict  pIn1,
const void *restrict  pOut 
)

This function checks the validity of the parameters passed to VXLIB_or_exec function. This function is called with the same parameters as the VXLIB_or_exec, and this function must be called before the VXLIB_or_exec is called.

Parameters
[in]handle: Active handle to the kernel
[in]pIn0: Pointer to the structure input image 0
[in]pIn1: Pointer to the structure input image 1
[out]pOut: Pointer to the output buffer
Returns
Status value indicating success or failure. Refer to VXLIB_STATUS.
Remarks
None

Definition at line 116 of file VXLIB_or.cpp.

◆ VXLIB_or_exec()

VXLIB_STATUS VXLIB_or_exec ( VXLIB_kernelHandle  handle,
void *restrict  pIn0,
void *restrict  pIn1,
void *restrict  pOut 
)

This function is the main kernel compute function.

Please refer to details under VXLIB_or_exec

Parameters
[in]handle: Active handle to the kernel
[in]pIn0: Pointer to the structure input image 0
[in]pIn1: Pointer to the structure input image 1
[out]pOut: Pointer to the output buffer
Returns
Status value indicating success or failure. Refer to VXLIB_STATUS.
Assumptions:
  • None
Performance Considerations:
For best performance,
  • the input and output data buffers are expected to be in L2 memory
  • the buffer pointers are assumed to be 64-byte aligned
Remarks
Before calling this function, application is expected to call VXLIB_or_init and VXLIB_or_exec_checkParams functions. This ensures resource configuration and error checks are done only once for several invocations of this function.

Definition at line 224 of file VXLIB_or.cpp.

◆ VXLIB_or_perfEst()

void VXLIB_or_perfEst ( VXLIB_kernelHandle  handle,
size_t *  archCycles,
size_t *  estCycles 
)

This function estimates the archCycles and estCycles.

Parameters
[in]handle: Active handle to the kernel
[out]archCycles: Arch compute cycles obtained from asm.
[out]estCycles: Estimated cycles including overhead.
Returns
None.
Assumptions:
  • None
  • Remarks
    This function is expected to be called when the estimation of cycles is needed.

Definition at line 214 of file VXLIB_or_ci.cpp.