21 #ifndef DSPLIB_SVD_IXX_IXX_OXX_PRIV_H_
22 #define DSPLIB_SVD_IXX_IXX_OXX_PRIV_H_
24 #include "../common/DSPLIB_inlines.h"
25 #include "../common/DSPLIB_utility.h"
26 #include "../DSPLIB_matTrans/DSPLIB_matTrans_priv.h"
40 #define DSPLIB_SVD_IXX_IXX_OXX_PBLOCK_SIZE (26 * SE_PARAM_SIZE)
52 void *restrict pSuperDiag,
55 void *restrict pScratch);
90 template <
typename dataType>
128 template <
typename dataType>
133 void *restrict pDiag,
134 void *restrict pSuperDiag,
137 void *restrict pScratch);
190 template <
typename dataType>
195 void *restrict pDiag,
196 void *restrict pSuperDiag,
199 void *restrict pScratch);
244 template <
typename dataType>
249 dataType half_norm_squared,
254 template <
typename dataType>
259 dataType *half_norm_squared,
264 template <
typename dataType>
269 dataType *half_norm_squared,
275 template <
typename dataType>
285 template <
typename dataType>
296 template <
typename dataType>
299 template <
typename dataType>
308 template <
typename dataType>
311 template <
typename dataType>
320 template <
typename dataType>
330 template <
typename dataType>
339 template <
typename dataType>
344 dataType half_norm_squared,
349 template <
typename dataType>
359 template <
typename dataType>
368 template <
typename dataType>
379 template <
typename dataType>
382 template <
typename dataType>
383 void DSPLIB_diag_epsilon_ci(dataType *diag, dataType *superdiag, dataType *epsilon, int32_t Ncols, uint8_t *pBlock);
385 template <
typename dataType>
390 int32_t *rotation_test,
394 template <
typename dataType>
404 template <
typename dataType>
406 dataType *singularBuffer,
411 template <
typename dataType>
412 void DSPLIB_diag_sqrt_ci(dataType *superdiag, dataType *diag, int32_t length, uint8_t *pBlock);
414 template <
typename dataType>
419 int32_t colOutStride,
442 template <
typename dataType>
445 dataType TwoP0 = 2.0;
447 dataType yy1 = __recip(value);
449 yy1 = yy1 * (TwoP0 - value * yy1);
450 yy1 = yy1 * (TwoP0 - value * yy1);
452 #if defined(ENABLE_LDRA_COVERAGE)
456 yy1 = yy1 * (TwoP0 - value * yy1);
457 yy1 = yy1 * (TwoP0 - value * yy1);
void DSPLIB_bidiag_uFinal_ci(dataType *U, int32_t Nrows, int32_t Ncols, int32_t colUStride, dataType s, dataType *U1, uint8_t *pBlock)
This function implements the process corresponding to the "update U" loop in natural implementation.
void DSPLIB_bidiag_uFinal_initalize_ci(dataType *U, int32_t Nrows, int32_t Ncols, int32_t colUStride, dataType s, dataType *U1, uint8_t *pBlock)
This function implements the process corresponding to the "initial U" loop in natural implementation.
void DSPLIB_singularSort_swap_init_ci(DSPLIB_kernelHandle handle)
void DSPLIB_diag_negate_v_ci(dataType *V, int32_t Ncols, int32_t colVStride, uint8_t *pBlock)
Negates the values of a row in V.
void DSPLIB_bidiag_uFinal_init_ci(DSPLIB_kernelHandle handle)
void DSPLIB_bidiag_v_init_ci(DSPLIB_kernelHandle handle)
void DSPLIB_singularSort_index_ci(dataType *singular_values, dataType *singularBuffer, int32_t *maxIndArr, int32_t Ncols, uint8_t *pBlock)
This function sorts the singular values in descending order and also records the max index values for...
DSPLIB_STATUS DSPLIB_svd_exec_cn(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 natural C implementation of the kernel....
void uRowProcess(dataType *U, int32_t Nrows, int32_t Ncols, int32_t colUStride, dataType *superdiag, dataType *U1, dataType scale, uint8_t *pBlock)
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....
void DSPLIB_diag_proc_init_ci(DSPLIB_kernelHandle handle)
void uColProcess(dataType *U, int32_t Nrows, int32_t Ncols, int32_t colUStride, dataType half_norm_squared, dataType *U1, dataType scale, uint8_t *pBlock)
void DSPLIB_diag_rotation_check_ci(dataType *diag, dataType *superdiag, dataType epsilon, int32_t *m, int32_t *rotation_test, int32_t Ncols, uint8_t *pBlock)
Updates values of "m" and "rotation_test" flag vased on the values present in "diag",...
void DSPLIB_svd_blk_move_ci(dataType *pOut, dataType *pIn, int32_t Nrows, int32_t Ncols, int32_t colOutStride, int32_t colInStride, uint8_t *pBlock)
Copy input matrix pIn to pOut.
void DSPLIB_bidiag_uCol_ci(dataType *U, int32_t Nrows, int32_t Ncols, int32_t colUStride, dataType half_norm_squared, dataType *U1, dataType scale, uint8_t *pBlock)
This function implements the Household processing on columns of input U matrix corresponding to the n...
DSPLIB_STATUS DSPLIB_svd_init_cn(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 natural C implementation of the kernel....
void DSPLIB_bidiag_v_ci(dataType *V, int32_t Nrows, int32_t Ncols, int32_t colVStride, dataType s, dataType *U1, dataType *U, int32_t colUStride, uint8_t *pBlock)
This function implements the process corresponding to the "update V" loop in natural implementation.
void DSPLIB_bidiag_uFinal_normalize_ci(dataType *U, int32_t Nrows, dataType s, int32_t colUStride, uint8_t *pBlock)
This function normalizes the column of input matrix U.
void DSPLIB_bidiag_uFinal_expand_ci(dataType *U, int32_t Nrows, int32_t Ncols, int32_t colUStride, uint8_t *pBlock)
This function expands columns of U matrix to get a square matrix and fill the columns with '0' values...
void DSPLIB_bidiag_u_init_ci(DSPLIB_kernelHandle handle)
void DSPLIB_svd_matTrans_init_ci(DSPLIB_kernelHandle handle, const DSPLIB_svdInitArgs *kerInitArgs)
void uSiUpdate(dataType *U, int32_t Nrows, int32_t Ncols, int32_t colUStride, dataType s, dataType *U1, uint8_t *pBlock)
DSPLIB_STATUS(* pFxnDSPLIB_svd_exec)(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 is a function pointer type that conforms to the declaration of DSPLIB_svd_exec_ci and DSPLIB_svd...
void DSPLIB_diag_epsilon_ci(dataType *diag, dataType *superdiag, dataType *epsilon, int32_t Ncols, uint8_t *pBlock)
Updates "epsilon" value based on absolute max values from "diag" and "superdiag" vectors.
#define DSPLIB_SVD_IXX_IXX_OXX_PBLOCK_SIZE
Macro to define the size of bufPblock array of DSPLIB_svd_PrivArgs structure.
dataType getRecip(dataType value)
dataType DSPLIB_bidiag_uRow_halfnorm_ci(dataType *U, int32_t Nrows, int32_t Ncols, int32_t colUStride, dataType *half_norm_squared, dataType *U1, dataType *s, dataType *superdiag, uint8_t *pBlock)
This function calculates the half-norm corresponding to the row of input matrix U and returns scale.
dataType DSPLIB_bidiag_uCol_halfnorm_ci(dataType *U, int32_t Nrows, int32_t Ncols, int32_t colUStride, dataType *half_norm_squared, dataType *U1, dataType *s, uint8_t *pBlock)
This function calculates the half-norms corresponding to the column of input matrix U and returns sca...
void DSPLIB_diag_proc_ci(dataType *V, int32_t startRow, int32_t Nrows, int32_t Ncols, int32_t rowVStride, dataType *cV, dataType *sV, uint8_t *pBlock)
Updates rows of V' and U' based on the precalculated cV/cU and sV/sU vectors.
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....
void DSPLIB_bidiag_uRow_ci(dataType *U, int32_t Nrows, int32_t Ncols, int32_t colUStride, dataType *superdiag, dataType *U1, dataType scale, uint8_t *pBlock)
This function implements the Household processing on rows of input U matrix corresponding to the natu...
void DSPLIB_diag_sqrt_ci(dataType *superdiag, dataType *diag, int32_t length, uint8_t *pBlock)
Calculates the reciprocal of square-roots of "diag" and "superdiag" vectors.
void vColProcess(dataType *V, int32_t Nrows, int32_t Ncols, int32_t colVStride, dataType s, dataType *U1, dataType *U, int32_t colUStride, uint8_t *PBlock)
void DSPLIB_diag_rotation_proc_ci(dataType *U, int32_t startRow, int32_t Nrows, int32_t Ncols, int32_t rowUStride, dataType *cU, dataType *sU, uint8_t *pBlock)
Updates rows of U' based on the precalculated cU and sU vectors.
void DSPLIB_singularSort_swap_ci(dataType *V, int32_t Nrows, int32_t Ncols, int32_t rowVStride, int32_t *sortIndex, dataType *vBuff, uint8_t *pBlock)
This function uses the max index values calculated from DSPLIB_singularSort_index_ci to shuffle the r...
DSPLIB_STATUS_NAME DSPLIB_STATUS
Return value for DSPLIB functions.
DSPLIB_STATUS_NAME
The enumeration of all status codes.
void * DSPLIB_kernelHandle
Handle type for DSPLIB operations.
A structure for a 1 dimensional buffer descriptor.
A structure for a 2 dimensional buffer descriptor.
Structure that is reserved for internal use by the kernel.
Structure containing the parameters to initialize the kernel.
Structure that is reserved for internal use by the kernel.
uint32_t widthIn
Size of input buffer for different batches DSPLIB_svd_init that will be retrieved and used by DSPLIB_...
DSPLIB_matTrans_PrivArgs pMatTransKerPrivArgs5
DSPLIB_matTrans_PrivArgs pMatTransKerPrivArgs2
uint32_t strideU
Stride between rows of U matrix
DSPLIB_matTrans_PrivArgs pMatTransKerPrivArgs4
uint32_t enableReducedForm
Flag for enabling the calculation of reduced form enableReducedForm = 1 for reduced form SVD calc ena...
DSPLIB_matTrans_PrivArgs pMatTransKerPrivArgs1
Privargs for the matTrans kernel.
pFxnDSPLIB_svd_exec execute
Function pointer to point to the right execution variant between DSPLIB_svd_exec_cn and DSPLIB_svd_ex...
int32_t strideIn
Stride between rows of input data matrix
uint32_t strideV
Stride between rows of V matrix
DSPLIB_matTrans_PrivArgs pMatTransKerPrivArgs3
uint32_t heightIn
Height of input data matrix