DSPLIB User Guide
DSPLIB_svd_ci.cpp File Reference

Go to the source code of this file.

Macros

#define MAX_ITERATION_COUNT   30
 

Functions

template<typename dataType >
DSPLIB_STATUS DSPLIB_svd_init_ci (DSPLIB_kernelHandle handle, const DSPLIB_bufParams2D_t *bufParamsIn, const DSPLIB_bufParams2D_t *bufParamsU, const DSPLIB_bufParams2D_t *bufParamsV, const DSPLIB_bufParams1D_t *bufParamsDiag, const DSPLIB_bufParams1D_t *bufParamsSuperDiag, const DSPLIB_svdInitArgs *pKerInitArgs)
 This function is the initialization function for the C7x implementation of the kernel. The function declaration conforms to the declaration of DSPLIB_svd_init. More...
 
template DSPLIB_STATUS DSPLIB_svd_init_ci< float > (DSPLIB_kernelHandle handle, const DSPLIB_bufParams2D_t *bufParamsIn, const DSPLIB_bufParams2D_t *bufParamsU, const DSPLIB_bufParams2D_t *bufParamsV, const DSPLIB_bufParams1D_t *bufParamsDiag, const DSPLIB_bufParams1D_t *bufParamsSuperDiag, const DSPLIB_svdInitArgs *pKerInitArgs)
 
template DSPLIB_STATUS DSPLIB_svd_init_ci< double > (DSPLIB_kernelHandle handle, const DSPLIB_bufParams2D_t *bufParamsIn, const DSPLIB_bufParams2D_t *bufParamsU, const DSPLIB_bufParams2D_t *bufParamsV, const DSPLIB_bufParams1D_t *bufParamsDiag, const DSPLIB_bufParams1D_t *bufParamsSuperDiag, const DSPLIB_svdInitArgs *pKerInitArgs)
 
template<typename dataType >
int DSPLIB_svd_convert_to_bidiag_ci (const int Nrows, const int Ncols, dataType *U, dataType *V, dataType *diag, dataType *superdiag, const int colUStride, const int colVStride, uint32_t enableReducedForm, dataType *U1, uint8_t *pBlock)
 
template int DSPLIB_svd_convert_to_bidiag_ci< float > (const int Nrows, const int Ncols, float *U, float *V, float *diag, float *superdiag, const int colUStride, const int colVStride, uint32_t enableReducedForm, float *U1, uint8_t *pBlock)
 
template int DSPLIB_svd_convert_to_bidiag_ci< double > (const int Nrows, const int Ncols, double *U, double *V, double *diag, double *superdiag, const int colUStride, const int colVStride, uint32_t enableReducedForm, double *U1, uint8_t *pBlock)
 
template<typename dataType >
static dataType getSqrt (dataType a)
 
template float getSqrt< float > (float a)
 
template double getSqrt< double > (double a)
 
template<typename dataType >
static dataType getRecipSqrt (dataType a)
 
template float getRecipSqrt< float > (float a)
 
template double getRecipSqrt< double > (double a)
 
template<typename dataType >
int DSPLIB_svd_bidiag_to_diag_ci (const int Nrows, const int Ncols, dataType *U, dataType *V, dataType *diag, dataType *superdiag, dataType *pTemp, const int colUStride, const int rowUStride, const int colVStride, const int rowVStride, uint32_t enableReducedForm, uint8_t *pBlock)
 
template int DSPLIB_svd_bidiag_to_diag_ci< float > (const int Nrows, const int Ncols, float *U, float *V, float *diag, float *superdiag, float *pTemp, const int colUStride, const int rowUStride, const int colVStride, const int rowVStride, uint32_t enableReducedForm, uint8_t *pBlock)
 
template int DSPLIB_svd_bidiag_to_diag_ci< double > (const int Nrows, const int Ncols, double *U, double *V, double *diag, double *superdiag, double *pTemp, const int colUStride, const int rowUStride, const int colVStride, const int rowVStride, uint32_t enableReducedForm, uint8_t *pBlock)
 
template<typename dataType >
int DSPLIB_svd_sort_singular_values_ci (const int Nrows, const int Ncols, dataType *U, dataType *U1, dataType *V, dataType *V1, dataType *singular_values, dataType *pScratch, const int colUStride, const int rowUStride, const int colVStride, const int rowVStride, uint32_t enableReducedForm, uint8_t *pBlock)
 
template int DSPLIB_svd_sort_singular_values_ci< float > (const int Nrows, const int Ncols, float *U, float *U1, float *V, float *V1, float *singular_values, float *pScratch, const int colUStride, const int rowUStride, const int colVStride, const int rowVStride, uint32_t enableReducedForm, uint8_t *pBlock)
 
template int DSPLIB_svd_sort_singular_values_ci< double > (const int Nrows, const int Ncols, double *U, double *U1, double *V, double *V1, double *singular_values, double *pScratch, const int colUStride, const int rowUStride, const int colVStride, const int rowVStride, uint32_t enableReducedForm, uint8_t *pBlock)
 
template<typename dataType >
DSPLIB_STATUS DSPLIB_svd_exec_ci (DSPLIB_kernelHandle handle, void *restrict pA, void *restrict pU, void *restrict pV, void *restrict pDiag, void *restrict pSuperDiag, void *restrict pU1, void *restrict pV1, void *restrict pScratch)
 This function is the main execution function for the C7x implementation of the kernel. The function declaration conforms to the declaration of DSPLIB_svd_exec. More...
 
template DSPLIB_STATUS DSPLIB_svd_exec_ci< float > (DSPLIB_kernelHandle handle, void *restrict pA, void *restrict pU, void *restrict pV, void *restrict pDiag, void *restrict pSuperDiag, void *restrict pU1, void *restrict pV1, void *restrict pScratch)
 
template DSPLIB_STATUS DSPLIB_svd_exec_ci< double > (DSPLIB_kernelHandle handle, void *restrict pA, void *restrict pU, void *restrict pV, void *restrict pDiag, void *restrict pSuperDiag, void *restrict pU1, void *restrict pV1, void *restrict pScratch)
 

Macro Definition Documentation

◆ MAX_ITERATION_COUNT

#define MAX_ITERATION_COUNT   30

Definition at line 55 of file DSPLIB_svd_ci.cpp.

Function Documentation

◆ DSPLIB_svd_init_ci()

template<typename dataType >
DSPLIB_STATUS DSPLIB_svd_init_ci ( DSPLIB_kernelHandle  handle,
const DSPLIB_bufParams2D_t bufParamsIn,
const DSPLIB_bufParams2D_t bufParamsU,
const DSPLIB_bufParams2D_t bufParamsV,
const DSPLIB_bufParams1D_t bufParamsDiag,
const DSPLIB_bufParams1D_t bufParamsSuperDiag,
const DSPLIB_svdInitArgs pKerInitArgs 
)

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

This function determines the configuration for the streaming engine resources based on the function call parameters, and the configuration is saved in bufPBlock array. In the kernel call sequence, DSPLIB_svd_exec_ci would be called later independently by the application. When DSPLIB_svd_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_svd_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
[out]bufParamsU: Pointer to the structure containing dimensional information of output buffer U
[out]bufParamsV: Pointer to the structure containing dimensional information of output buffer V
[out]bufParamsDiag: Pointer to the structure containing dimensional information of output buffer Diag
[out]bufParamsSuperDiag: Pointer to the structure containing dimensional information of output buffer SuperDiag
[in]pKerInitArgs: Pointer to the structure holding init parameters
Returns
Status value indicating success or failure. Refer to DSPLIB_STATUS.

Definition at line 64 of file DSPLIB_svd_ci.cpp.

◆ DSPLIB_svd_init_ci< float >()

template DSPLIB_STATUS DSPLIB_svd_init_ci< float > ( DSPLIB_kernelHandle  handle,
const DSPLIB_bufParams2D_t bufParamsIn,
const DSPLIB_bufParams2D_t bufParamsU,
const DSPLIB_bufParams2D_t bufParamsV,
const DSPLIB_bufParams1D_t bufParamsDiag,
const DSPLIB_bufParams1D_t bufParamsSuperDiag,
const DSPLIB_svdInitArgs pKerInitArgs 
)

◆ DSPLIB_svd_init_ci< double >()

template DSPLIB_STATUS DSPLIB_svd_init_ci< double > ( DSPLIB_kernelHandle  handle,
const DSPLIB_bufParams2D_t bufParamsIn,
const DSPLIB_bufParams2D_t bufParamsU,
const DSPLIB_bufParams2D_t bufParamsV,
const DSPLIB_bufParams1D_t bufParamsDiag,
const DSPLIB_bufParams1D_t bufParamsSuperDiag,
const DSPLIB_svdInitArgs pKerInitArgs 
)

◆ DSPLIB_svd_convert_to_bidiag_ci()

template<typename dataType >
int DSPLIB_svd_convert_to_bidiag_ci ( const int  Nrows,
const int  Ncols,
dataType *  U,
dataType *  V,
dataType *  diag,
dataType *  superdiag,
const int  colUStride,
const int  colVStride,
uint32_t  enableReducedForm,
dataType *  U1,
uint8_t *  pBlock 
)

Definition at line 112 of file DSPLIB_svd_ci.cpp.

◆ DSPLIB_svd_convert_to_bidiag_ci< float >()

template int DSPLIB_svd_convert_to_bidiag_ci< float > ( const int  Nrows,
const int  Ncols,
float *  U,
float *  V,
float *  diag,
float *  superdiag,
const int  colUStride,
const int  colVStride,
uint32_t  enableReducedForm,
float *  U1,
uint8_t *  pBlock 
)

◆ DSPLIB_svd_convert_to_bidiag_ci< double >()

template int DSPLIB_svd_convert_to_bidiag_ci< double > ( const int  Nrows,
const int  Ncols,
double *  U,
double *  V,
double *  diag,
double *  superdiag,
const int  colUStride,
const int  colVStride,
uint32_t  enableReducedForm,
double *  U1,
uint8_t *  pBlock 
)

◆ getSqrt()

template<typename dataType >
static dataType getSqrt ( dataType  a)
inlinestatic

Definition at line 228 of file DSPLIB_svd_ci.cpp.

◆ getSqrt< float >()

template float getSqrt< float > ( float  a)

◆ getSqrt< double >()

template double getSqrt< double > ( double  a)

◆ getRecipSqrt()

template<typename dataType >
static dataType getRecipSqrt ( dataType  a)
inlinestatic

Definition at line 251 of file DSPLIB_svd_ci.cpp.

◆ getRecipSqrt< float >()

template float getRecipSqrt< float > ( float  a)

◆ getRecipSqrt< double >()

template double getRecipSqrt< double > ( double  a)

◆ DSPLIB_svd_bidiag_to_diag_ci()

template<typename dataType >
int DSPLIB_svd_bidiag_to_diag_ci ( const int  Nrows,
const int  Ncols,
dataType *  U,
dataType *  V,
dataType *  diag,
dataType *  superdiag,
dataType *  pTemp,
const int  colUStride,
const int  rowUStride,
const int  colVStride,
const int  rowVStride,
uint32_t  enableReducedForm,
uint8_t *  pBlock 
)

Definition at line 274 of file DSPLIB_svd_ci.cpp.

◆ DSPLIB_svd_bidiag_to_diag_ci< float >()

template int DSPLIB_svd_bidiag_to_diag_ci< float > ( const int  Nrows,
const int  Ncols,
float *  U,
float *  V,
float *  diag,
float *  superdiag,
float *  pTemp,
const int  colUStride,
const int  rowUStride,
const int  colVStride,
const int  rowVStride,
uint32_t  enableReducedForm,
uint8_t *  pBlock 
)

◆ DSPLIB_svd_bidiag_to_diag_ci< double >()

template int DSPLIB_svd_bidiag_to_diag_ci< double > ( const int  Nrows,
const int  Ncols,
double *  U,
double *  V,
double *  diag,
double *  superdiag,
double *  pTemp,
const int  colUStride,
const int  rowUStride,
const int  colVStride,
const int  rowVStride,
uint32_t  enableReducedForm,
uint8_t *  pBlock 
)

◆ DSPLIB_svd_sort_singular_values_ci()

template<typename dataType >
int DSPLIB_svd_sort_singular_values_ci ( const int  Nrows,
const int  Ncols,
dataType *  U,
dataType *  U1,
dataType *  V,
dataType *  V1,
dataType *  singular_values,
dataType *  pScratch,
const int  colUStride,
const int  rowUStride,
const int  colVStride,
const int  rowVStride,
uint32_t  enableReducedForm,
uint8_t *  pBlock 
)

Definition at line 544 of file DSPLIB_svd_ci.cpp.

◆ DSPLIB_svd_sort_singular_values_ci< float >()

template int DSPLIB_svd_sort_singular_values_ci< float > ( const int  Nrows,
const int  Ncols,
float *  U,
float *  U1,
float *  V,
float *  V1,
float *  singular_values,
float *  pScratch,
const int  colUStride,
const int  rowUStride,
const int  colVStride,
const int  rowVStride,
uint32_t  enableReducedForm,
uint8_t *  pBlock 
)

◆ DSPLIB_svd_sort_singular_values_ci< double >()

template int DSPLIB_svd_sort_singular_values_ci< double > ( const int  Nrows,
const int  Ncols,
double *  U,
double *  U1,
double *  V,
double *  V1,
double *  singular_values,
double *  pScratch,
const int  colUStride,
const int  rowUStride,
const int  colVStride,
const int  rowVStride,
uint32_t  enableReducedForm,
uint8_t *  pBlock 
)

◆ DSPLIB_svd_exec_ci()

template<typename dataType >
DSPLIB_STATUS DSPLIB_svd_exec_ci ( DSPLIB_kernelHandle  handle,
void *restrict  pA,
void *restrict  pU,
void *restrict  pV,
void *restrict  pDiag,
void *restrict  pSuperDiag,
void *restrict  pU1,
void *restrict  pV1,
void *restrict  pScratch 
)

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

Parameters
[in]handle: Active handle to the kernel
[in]pA: Pointer to the input buffer pA
[out]pU: Pointer to the output buffer pU
[out]pV: Pointer to the output buffer pV
[out]pDiag: Pointer to the output buffer pDiag
[out]pSuperDiag: Pointer to the output buffer pSuperDiag
[in]pU1: Pointer to the buffer pU1
[in]pV1: Pointer to the buffer pV1
[out]pScratch: Pointer to the buffer pScratch
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
Assumptions:
The arrays A, U, V, Diag, SuperDiag, U1, V1 and Scratch are stored in distinct arrays In-place processing of A is not allowed.

Definition at line 612 of file DSPLIB_svd_ci.cpp.

◆ DSPLIB_svd_exec_ci< float >()

template DSPLIB_STATUS DSPLIB_svd_exec_ci< float > ( DSPLIB_kernelHandle  handle,
void *restrict  pA,
void *restrict  pU,
void *restrict  pV,
void *restrict  pDiag,
void *restrict  pSuperDiag,
void *restrict  pU1,
void *restrict  pV1,
void *restrict  pScratch 
)

◆ DSPLIB_svd_exec_ci< double >()

template DSPLIB_STATUS DSPLIB_svd_exec_ci< double > ( DSPLIB_kernelHandle  handle,
void *restrict  pA,
void *restrict  pU,
void *restrict  pV,
void *restrict  pDiag,
void *restrict  pSuperDiag,
void *restrict  pU1,
void *restrict  pV1,
void *restrict  pScratch 
)