DSPLIB User Guide
DSPLIB_matMul_fixed_priv.h File Reference

Introduction

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

Definition in file DSPLIB_matMul_fixed_priv.h.

Go to the source code of this file.

Data Structures

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

Macros

#define DSPLIB_MATMUL_FIXED_IXX_IXX_OXX_PBLOCK_SIZE   (3 * SE_PARAM_SIZE)
 Macro to define the size of bufPblock array of DSPLIB_matMul_fixed_PrivArgs structure. More...
 
#define DSPLIB_MATMAPY_FXD_I8S_O8S   int8_t, c7x::int_vec
 
#define DSPLIB_MATMAPY_FXD_I16S_O16S   int16_t, c7x::long_vec
 

Typedefs

typedef DSPLIB_STATUS(* pFxnDSPLIB_matMul_fixed_exec) (DSPLIB_kernelHandle handle, void *restrict pIn1, void *restrict pIn2, void *restrict pOut)
 Macro to define the size of bufPblock array of DSPLIB_matMul_fixed_PrivArgs structure. More...
 

Functions

template<typename dataTypeIn , typename dataTypeOut >
DSPLIB_STATUS DSPLIB_matMul_fixed_init_ci (DSPLIB_kernelHandle handle, const DSPLIB_bufParams2D_t *bufParamsIn0, const DSPLIB_bufParams2D_t *bufParamsIn1, const DSPLIB_bufParams2D_t *bufParamsOut, const DSPLIB_matMul_fixed_InitArgs *pKerInitArgs)
 This function is the initialization function for the C7x implementation of the kernel. The function declaration conforms to the declaration of DSPLIB_matMul_fixed_init. More...
 
template<typename dataTypeIn , typename dataTypeOut >
DSPLIB_STATUS DSPLIB_matMul_fixed_exec_ci (DSPLIB_kernelHandle handle, void *restrict pIn1, void *restrict pIn2, void *restrict pOut)
 This function is the main execution function for the C7x implementation of the kernel. The function declaration conforms to the declaration of DSPLIB_matMul_fixed_exec. More...
 
template<typename dataType >
DSPLIB_STATUS DSPLIB_matMul_fixed_exec_cn (DSPLIB_kernelHandle handle, void *restrict pIn1, void *restrict pIn2, void *restrict pOut)
 This function is the main execution function for the natural C implementation of the kernel. The function declaration conforms to the declaration of DSPLIB_matMul_fixed_exec. More...
 
DSPLIB_STATUS DSPLIB_matMul_fixed_init_cn (DSPLIB_kernelHandle handle, DSPLIB_bufParams2D_t *bufParamsIn0, DSPLIB_bufParams2D_t *bufParamsIn1, DSPLIB_bufParams2D_t *bufParamsOut)
 This function is the initialization function for the natural C implementation of the kernel. The function declaration conforms to the declaration of DSPLIB_matMul_fixed_init. More...
 
template<typename dataTypeIn , typename dataTypeOut >
DSPLIB_STATUS DSPLIB_matMul_fixed_generic_init_ci (DSPLIB_kernelHandle handle, const DSPLIB_bufParams2D_t *bufParamsIn0, const DSPLIB_bufParams2D_t *bufParamsIn1, const DSPLIB_bufParams2D_t *bufParamsOut, const DSPLIB_matMul_fixed_InitArgs *pKerInitArgs)
 
template<typename dataTypeIn , typename dataTypeOut >
DSPLIB_STATUS DSPLIB_matMul_fixed_generic_exec_ci (DSPLIB_kernelHandle handle, void *restrict pIn0, void *restrict pIn1, void *restrict pOut)
 
template<typename dataType >
void printStridedMat (char *inStr, int Nrows, int colStride, dataType *inMat)
 
template void printStridedMat< int16_t > (char *inStr, int Nrows, int colStride, int16_t *inMat)
 
template void printStridedMat< int8_t > (char *inStr, int Nrows, int colStride, int8_t *inMat)
 
template<typename dataType >
DSPLIB_STATUS DSPLIB_matMul_fixed_generic_init_ci (DSPLIB_kernelHandle handle, const DSPLIB_bufParams2D_t *bufParamsIn0, const DSPLIB_bufParams2D_t *bufParamsIn1, const DSPLIB_bufParams2D_t *bufParamsOut, const DSPLIB_matMul_fixed_InitArgs *pKerInitArgs)
 
template<typename dataType >
DSPLIB_STATUS DSPLIB_matMul_fixed_N_unroll_init_ci (DSPLIB_kernelHandle handle, const DSPLIB_bufParams2D_t *bufParamsIn0, const DSPLIB_bufParams2D_t *bufParamsIn1, const DSPLIB_bufParams2D_t *bufParamsOut, const DSPLIB_matMul_fixed_InitArgs *pKerInitArgs)
 
template<typename dataType >
DSPLIB_STATUS DSPLIB_matMul_fixed_N_unroll_exec_ci (DSPLIB_kernelHandle handle, void *restrict pIn0, void *restrict pIn1, void *restrict pOut)
 

Macro Definition Documentation

◆ DSPLIB_MATMUL_FIXED_IXX_IXX_OXX_PBLOCK_SIZE

#define DSPLIB_MATMUL_FIXED_IXX_IXX_OXX_PBLOCK_SIZE   (3 * SE_PARAM_SIZE)

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

Definition at line 39 of file DSPLIB_matMul_fixed_priv.h.

◆ DSPLIB_MATMAPY_FXD_I8S_O8S

#define DSPLIB_MATMAPY_FXD_I8S_O8S   int8_t, c7x::int_vec

Definition at line 40 of file DSPLIB_matMul_fixed_priv.h.

◆ DSPLIB_MATMAPY_FXD_I16S_O16S

#define DSPLIB_MATMAPY_FXD_I16S_O16S   int16_t, c7x::long_vec

Definition at line 41 of file DSPLIB_matMul_fixed_priv.h.

Typedef Documentation

◆ pFxnDSPLIB_matMul_fixed_exec

typedef DSPLIB_STATUS(* pFxnDSPLIB_matMul_fixed_exec) (DSPLIB_kernelHandle handle, void *restrict pIn1, void *restrict pIn2, void *restrict pOut)

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

This is a function pointer type that conforms to the declaration of DSPLIB_matMul_fixed_exec_ci and DSPLIB_matMul_fixed_exec_cn.

Definition at line 55 of file DSPLIB_matMul_fixed_priv.h.

Function Documentation

◆ DSPLIB_matMul_fixed_init_ci()

template<typename dataTypeIn , typename dataTypeOut >
DSPLIB_STATUS DSPLIB_matMul_fixed_init_ci ( DSPLIB_kernelHandle  handle,
const DSPLIB_bufParams2D_t bufParamsIn0,
const DSPLIB_bufParams2D_t bufParamsIn1,
const DSPLIB_bufParams2D_t bufParamsOut,
const DSPLIB_matMul_fixed_InitArgs pKerInitArgs 
)

This function is the initialization function for the C7x implementation of the kernel. The function declaration conforms to the declaration of DSPLIB_matMul_fixed_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_matMul_fixed_exec_ci would be called later independently by the application. When DSPLIB_matMul_fixed_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_matMul_fixed_exec_ci does not lose cycles to determine the hardware configuration.

Parameters
[in]handle: Active handle to the kernel
[in]bufParamsIn1: Pointer to the structure containing dimensional information of input buffer 1
[in]bufParamsIn2: Pointer to the structure containing dimensional information of input buffer 2
[out]bufParamsOut: Pointer to the structure containing dimensional 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 77 of file DSPLIB_matMul_fixed_ci.cpp.

◆ DSPLIB_matMul_fixed_exec_ci()

template<typename dataTypeIn , typename dataTypeOut >
DSPLIB_STATUS DSPLIB_matMul_fixed_exec_ci ( DSPLIB_kernelHandle  handle,
void *restrict  pIn1,
void *restrict  pIn2,
void *restrict  pOut 
)

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

The function uses MMA hardware accelerator to perform the convolution computation. Filter data is loaded into B panel of the MMA from memory using one streaming engine, while the input data is loaded into A vectors of the MMA using the other streaming engine. Result of the compute from MMA C panel is stored into memory using a stream matMul_fixedress generator.

Parameters
[in]handle: Active handle to the kernel
[in]pIn: Pointer to buffer holding the input data
[out]pOut: Pointer to buffer holding the output data
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

Definition at line 388 of file DSPLIB_matMul_fixed_ci.cpp.

◆ DSPLIB_matMul_fixed_exec_cn()

template<typename dataType >
DSPLIB_STATUS DSPLIB_matMul_fixed_exec_cn ( DSPLIB_kernelHandle  handle,
void *restrict  pIn1,
void *restrict  pIn2,
void *restrict  pOut 
)

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

Parameters
[in]handle: Active handle to the kernel
[in]pIn: Pointer to buffer holding the input data
[in]pFilterCoeffPointer to buffer holding the filter coefficient data
[in]pFilterVar: Pointer to buffer holding the filter variable data
[out]pOut: Pointer to buffer holding the output data
Returns
Status value indicating success or failure. Refer to DSPLIB_STATUS.

Definition at line 34 of file DSPLIB_matMul_fixed_cn.cpp.

◆ DSPLIB_matMul_fixed_init_cn()

DSPLIB_STATUS DSPLIB_matMul_fixed_init_cn ( DSPLIB_kernelHandle  handle,
DSPLIB_bufParams2D_t bufParamsIn0,
DSPLIB_bufParams2D_t bufParamsIn1,
DSPLIB_bufParams2D_t bufParamsOut 
)

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

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

◆ DSPLIB_matMul_fixed_generic_init_ci() [1/2]

template<typename dataTypeIn , typename dataTypeOut >
DSPLIB_STATUS DSPLIB_matMul_fixed_generic_init_ci ( DSPLIB_kernelHandle  handle,
const DSPLIB_bufParams2D_t bufParamsIn0,
const DSPLIB_bufParams2D_t bufParamsIn1,
const DSPLIB_bufParams2D_t bufParamsOut,
const DSPLIB_matMul_fixed_InitArgs pKerInitArgs 
)

◆ DSPLIB_matMul_fixed_generic_exec_ci()

template<typename dataTypeIn , typename dataTypeOut >
DSPLIB_STATUS DSPLIB_matMul_fixed_generic_exec_ci ( DSPLIB_kernelHandle  handle,
void *restrict  pIn0,
void *restrict  pIn1,
void *restrict  pOut 
)

◆ printStridedMat()

template<typename dataType >
void printStridedMat ( char *  inStr,
int  Nrows,
int  colStride,
dataType *  inMat 
)

Definition at line 211 of file DSPLIB_matMul_fixed_priv.h.

◆ printStridedMat< int16_t >()

template void printStridedMat< int16_t > ( char *  inStr,
int  Nrows,
int  colStride,
int16_t *  inMat 
)

◆ printStridedMat< int8_t >()

template void printStridedMat< int8_t > ( char *  inStr,
int  Nrows,
int  colStride,
int8_t *  inMat 
)

◆ DSPLIB_matMul_fixed_generic_init_ci() [2/2]

template<typename dataType >
DSPLIB_STATUS DSPLIB_matMul_fixed_generic_init_ci ( DSPLIB_kernelHandle  handle,
const DSPLIB_bufParams2D_t bufParamsIn0,
const DSPLIB_bufParams2D_t bufParamsIn1,
const DSPLIB_bufParams2D_t bufParamsOut,
const DSPLIB_matMul_fixed_InitArgs pKerInitArgs 
)

◆ DSPLIB_matMul_fixed_N_unroll_init_ci()

template<typename dataType >
DSPLIB_STATUS DSPLIB_matMul_fixed_N_unroll_init_ci ( DSPLIB_kernelHandle  handle,
const DSPLIB_bufParams2D_t bufParamsIn0,
const DSPLIB_bufParams2D_t bufParamsIn1,
const DSPLIB_bufParams2D_t bufParamsOut,
const DSPLIB_matMul_fixed_InitArgs pKerInitArgs 
)

◆ DSPLIB_matMul_fixed_N_unroll_exec_ci()

template<typename dataType >
DSPLIB_STATUS DSPLIB_matMul_fixed_N_unroll_exec_ci ( DSPLIB_kernelHandle  handle,
void *restrict  pIn0,
void *restrict  pIn1,
void *restrict  pOut 
)