40 #include "../VXLIB_addSquare/VXLIB_addSquare_priv.h"
75 uint32_t dTypeIn = bufParamsIn->
data_type;
76 uint32_t widthIn = bufParamsIn->
dim_x;
77 uint32_t heightIn = bufParamsIn->
dim_y;
78 uint32_t strideIn = bufParamsIn->
stride_y;
81 uint32_t dTypeOut = bufParamsOut->
data_type;
82 uint32_t widthOut = bufParamsOut->
dim_x;
83 uint32_t heightOut = bufParamsOut->
dim_y;
84 uint32_t strideOut = bufParamsOut->
stride_y;
93 else if ((widthIn != widthOut) || (heightIn != heightOut)) {
96 else if (strideInElements < widthIn || strideOutElements < widthOut) {
117 const void *restrict pIn,
118 const void *restrict pOut,
119 const uint32_t shift)
124 printf(
"Enter VXLIB_accumulateSquareImage_exec_checkParams\n");
126 if ((handle == NULL) || (pIn == NULL) || (pOut == NULL)) {
167 printf(
"VXLIB_DEBUGPRINT Enter VXLIB_accumulateSquareImage_init\n");
171 uint32_t dTypeIn = bufParamsIn->
data_type;
172 uint32_t dTypeOut = bufParamsOut->
data_type;
193 bufParamsOut, kerInitArgsAddSquare);
216 printf(
"VXLIB_DEBUGPRINT Enter VXLIB_accumulateSquareImage_exec\n");
221 status = pKerPrivArgs->
execute(handle, pIn, pOut, pOut, shift);
233 size_t numBlocks = pKerPrivArgs->
numBlocks;
234 size_t overheadCnt = 17;
235 *archCycles = 7 + numBlocks * 2;
236 *estCycles = overheadCnt + *archCycles;
Header file for kernel's internal use. For the kernel's interface. Note: The VXLIB_accumulateSquareIm...
#define VXLIB_ACCUMULATESQUAREIMAGE_I8U_O16S
Macros that will be useful to check for datatype combinations.
template VXLIB_STATUS VXLIB_addSquare_init_ci< VXLIB_ADDSQUARE_DTYPE_I8U_I16S_O16S >(VXLIB_kernelHandle handle, const VXLIB_bufParams2D_t *bufParamsIn0, const VXLIB_bufParams2D_t *bufParamsIn1, const VXLIB_bufParams2D_t *bufParamsOut, const VXLIB_addSquare_InitArgs *pKerInitArgs)
template VXLIB_STATUS VXLIB_addSquare_exec_ci< VXLIB_ADDSQUARE_TYPENAME_I8U_I16S_O16S >(VXLIB_kernelHandle handle, void *restrict pIn0, void *restrict pIn1, void *restrict pOut, uint32_t shift)
template VXLIB_STATUS VXLIB_addSquare_exec_cn< VXLIB_ADDSQUARE_TYPENAME_I8U_I16S_O16S >(VXLIB_kernelHandle handle, void *restrict pIn0, void *restrict pIn1, void *restrict pOut, uint32_t shift)
void * VXLIB_kernelHandle
Handle type for VXLIB operations.
VXLIB_STATUS_NAME
The enumeration of all status codes.
@ VXLIB_ERR_INVALID_DIMENSION
@ VXLIB_ERR_NOT_EQUAL_WIDTH_STRIDE
static int32_t VXLIB_sizeof(uint32_t type)
Inline function returns number of bytes per element given a type of VXLIB_data_type_e.
VXLIB_STATUS VXLIB_accumulateSquareImage_exec(VXLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut, uint32_t shift)
This function is the main kernel compute function.
void VXLIB_accumulateSquareImage_perfEst(VXLIB_kernelHandle handle, size_t *archCycles, size_t *estCycles)
VXLIB_STATUS VXLIB_accumulateSquareImage_init(VXLIB_kernelHandle handle, VXLIB_bufParams2D_t *bufParamsIn, VXLIB_bufParams2D_t *bufParamsOut, const VXLIB_accumulateSquareImage_InitArgs *pKerInitArgs)
This function should be called before the VXLIB_accumulateSquareImage_exec function is called....
VXLIB_STATUS VXLIB_accumulateSquareImage_exec_checkParams(VXLIB_kernelHandle handle, const void *restrict pIn, const void *restrict pOut, const uint32_t shift)
This function checks the validity of the parameters passed to VXLIB_accumulateSquareImage_exec functi...
int32_t VXLIB_accumulateSquareImage_getHandleSize(VXLIB_accumulateSquareImage_InitArgs *pKerInitArgs)
This is a query function to calculate the size of internal handle.
VXLIB_STATUS VXLIB_accumulateSquareImage_init_checkParams(VXLIB_kernelHandle handle, const VXLIB_bufParams2D_t *bufParamsIn, const VXLIB_bufParams2D_t *bufParamsOut, const VXLIB_accumulateSquareImage_InitArgs *pKerInitArgs)
This function checks the validity of the parameters passed to VXLIB_accumulateSquareImage_init functi...
Structure containing the parameters to initialize the kernel.
int8_t funcStyle
Variant of the function, refer to VXLIB_FUNCTION_STYLE
Structure containing the parameters to initialize the kernel.
Structure that is reserved for internal use by the kernel.
pFxnVXLIB_addSquare_exec execute
Function pointer to point to the right execution variant between VXLIB_addSquare_exec_cn and VXLIB_ad...
size_t strideIn0Elements
Stride of input0 in elements.
VXLIB_addSquare_InitArgs pKerInitArgs
Initargs of the kernel.
size_t strideIn1Elements
Stride of input1 in elements.
size_t numBlocks
Number of blocks to be processed after simidfication.
size_t strideOutElements
Stride of output in elements.
size_t width
Width of image
size_t height
Height of image
A structure for a 2 dimensional buffer descriptor.
uint32_t dim_y
Height of buffer in Y dimension in elements.
uint32_t dim_x
Width of buffer in X dimension in elements.
uint32_t data_type
Values are of type VXLIB_data_type_e.
int32_t stride_y
Stride in Y dimension in bytes.