DSPLIB User Guide
DSPLIB_minerror_priv.h File Reference

Introduction

Header file for kernel's internal use. For the kernel's interface, please see DSPLIB_minerror.

Definition in file DSPLIB_minerror_priv.h.

Go to the source code of this file.

Data Structures

struct  DSPLIB_minerror_PrivArgs
 Structure that is reserved for internal use by the kernel. More...
 

Macros

#define DSPLIB_MINERROR_IXX_IXX_OXX_PBLOCK_SIZE   (2 * SE_PARAM_SIZE + 1 * DSPLIB_PARAM_SIZE + 2 * sizeof(int32_t))
 Macro to define the size of bufPblock array of DSPLIB_minerror_PrivArgs structure. More...
 

Typedefs

typedef DSPLIB_STATUS(* pFxnDSPLIB_minerror_exec) (DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pErrCoefs, const int *restrict pMaxIndex, const void *restrict pMaxVal)
 This is a function pointer type that conforms to the declaration of DSPLIB_minerror_exec_ci and DSPLIB_minerror_exec_cn. More...
 

Functions

template<typename dataType >
DSPLIB_STATUS DSPLIB_minerror_init_ci (DSPLIB_kernelHandle handle, const DSPLIB_bufParams2D_t *bufParamsIn, const DSPLIB_bufParams1D_t *bufParamsErrCoefs, const DSPLIB_bufParams1D_t *bufParamsOutIndex, const DSPLIB_bufParams1D_t *bufParamsOutVal, const DSPLIB_minerror_InitArgs *pKerInitArgs)
 This function is the initialization function for the C7x implementation of the kernel. The function declaration conforms to the declaration of DSPLIB_minerror_init. More...
 
template<typename dataType >
DSPLIB_STATUS DSPLIB_minerror_exec_ci (DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pErrCoefs, const int *restrict pMaxIndex, const void *restrict pMaxVal)
 This function is the main execution function for the C7x implementation of the kernel. The function declaration conforms to the declaration of DSPLIB_minerror_exec. More...
 
template<typename dataType >
DSPLIB_STATUS DSPLIB_minerror_exec_cn (DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pErrCoefs, const int *restrict pMaxIndex, const void *restrict pMaxVal)
 This function is the main execution function for the natural C implementation of the kernel. The function declaration conforms to the declaration of DSPLIB_minerror_exec. More...
 
DSPLIB_STATUS DSPLIB_minerror_init_cn (DSPLIB_kernelHandle handle, DSPLIB_bufParams2D_t *bufParamsIn, DSPLIB_bufParams1D_t *bufParamsErrCoefs, const int *pMaxIndex, const void *pMaxVal)
 This function is the initialization function for the natural C implementation of the kernel. The function declaration conforms to the declaration of DSPLIB_minerror_init. More...
 

Macro Definition Documentation

◆ DSPLIB_MINERROR_IXX_IXX_OXX_PBLOCK_SIZE

#define DSPLIB_MINERROR_IXX_IXX_OXX_PBLOCK_SIZE   (2 * SE_PARAM_SIZE + 1 * DSPLIB_PARAM_SIZE + 2 * sizeof(int32_t))

Macro to define the size of bufPblock array of DSPLIB_minerror_PrivArgs structure.

Definition at line 39 of file DSPLIB_minerror_priv.h.

Typedef Documentation

◆ pFxnDSPLIB_minerror_exec

typedef DSPLIB_STATUS(* pFxnDSPLIB_minerror_exec) (DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pErrCoefs, const int *restrict pMaxIndex, const void *restrict pMaxVal)

This is a function pointer type that conforms to the declaration of DSPLIB_minerror_exec_ci and DSPLIB_minerror_exec_cn.

Definition at line 45 of file DSPLIB_minerror_priv.h.

Function Documentation

◆ DSPLIB_minerror_init_ci()

template<typename dataType >
DSPLIB_STATUS DSPLIB_minerror_init_ci ( DSPLIB_kernelHandle  handle,
const DSPLIB_bufParams2D_t bufParamsIn,
const DSPLIB_bufParams1D_t bufParamsErrCoefs,
const DSPLIB_bufParams1D_t bufParamsOutIndex,
const DSPLIB_bufParams1D_t bufParamsOutVal,
const DSPLIB_minerror_InitArgs pKerInitArgs 
)

This function is the initialization function for the C7x implementation of the kernel. The function declaration conforms to the declaration of DSPLIB_minerror_init.

This function determines the configuration for the streaming engine and MMA hardware resources based on the function call parameters, and the configuration is saved in bufPBlock array. In the kernel call sequence, DSPLIB_minerror_exec_ci would be called later independently by the application. When DSPLIB_minerror_exec_ci runs, it merely retrieves the configuration from the bufPBlock and uses it to set up the hardware resources. This arrangement is so that DSPLIB_minerror_exec_ci does not lose cycles to determine the hardware configuration.

Parameters
[in]handle: Active handle to the kernel
[in]bufParamsIn: Pointer to the structure containing dimensional information of input buffer
[in]bufParamsErrCoefs: Pointer to the structure containing error coefficients information of input buffer
[out]pMaxIndex: Pointer to the structure containing information of ouput buffer
[in]pKerInitArgs: Pointer to the structure holding init parameters
Returns
Status value indicating success or failure. Refer to DSPLIB_STATUS.

Definition at line 63 of file DSPLIB_minerror_ci.cpp.

◆ DSPLIB_minerror_exec_ci()

template<typename dataType >
DSPLIB_STATUS DSPLIB_minerror_exec_ci ( DSPLIB_kernelHandle  handle,
void *restrict  pIn,
void *restrict  pErrCoefs,
const int *restrict  pMaxIndex,
const void *restrict  pMaxVal 
)

This function is the main execution function for the C7x implementation of the kernel. The function declaration conforms to the declaration of DSPLIB_minerror_exec.

The function uses streaming engine and C7x DSP to perform the minerror computation.

Parameters
[in]handle: Active handle to the kernel
[in]bufParamsIn: Pointer to the structure containing dimensional information of input buffer
[in]bufParamsErrCoefs: Pointer to the structure containing error coefficients information of input buffer
[out]bufParamsOutIndex: Pointer to the structure containing information of ouput buffer
[out]bufParamsOutVal: Pointer to the structure containing information of ouput buffer
[in]pKerInitArgs: Pointer to the structure holding init parameters
Returns
Status value indicating success or failure. Refer to DSPLIB_STATUS.
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

◆ DSPLIB_minerror_exec_cn()

template<typename dataType >
DSPLIB_STATUS DSPLIB_minerror_exec_cn ( DSPLIB_kernelHandle  handle,
void *restrict  pIn,
void *restrict  pErrCoefs,
const int *restrict  pMaxIndex,
const void *restrict  pMaxVal 
)

This function is the main execution function for the natural C implementation of the kernel. The function declaration conforms to the declaration of DSPLIB_minerror_exec.

Parameters
[in]handle: Active handle to the kernel
[in]pIn: Pointer to buffer holding the input data
[in]pErrCoeff: Pointer to buffer holding the error coefficient data
[out]pMaxIndex: Pointer to buffer holding the index to the element vector that resulted in the maximum dot product
[out]pMaxVal: Pointer to buffer holding the value of the maximum dot product
Returns
Status value indicating success or failure. Refer to DSPLIB_STATUS.

◆ DSPLIB_minerror_init_cn()

DSPLIB_STATUS DSPLIB_minerror_init_cn ( DSPLIB_kernelHandle  handle,
DSPLIB_bufParams2D_t bufParamsIn,
DSPLIB_bufParams1D_t bufParamsErrCoefs,
const int *  pMaxIndex,
const void *  pMaxVal 
)

This function is the initialization function for the natural C implementation of the kernel. The function declaration conforms to the declaration of DSPLIB_minerror_init.

Parameters
[in]handle: Active handle to the kernel
[in]bufParamsIn: Pointer to the structure containing dimensional information of input buffer
[in]bufParamsErrCoefs: Pointer to the structure containing error coefficients information of input buffer
[out]bufParamsOutIndex: Pointer to the structure containing information of ouput buffer
[out]bufParamsOutVal: Pointer to the structure containing information of ouput buffer
[in]pKerInitArgs: Pointer to the structure holding init parameters
Returns
Status value indicating success or failure. Refer to DSPLIB_STATUS.