![]() |
DSPLIB User Guide
|
Kernel for calculating Singular Value Decomposition (SVD).
\begin{eqnarray*} A = U \times \Sigma \times V^{T} \qquad where\;&(1)&V^{T}\;is\;transpose\;of\;V.\\ &(2)& \Sigma \;is\;a\;diagonal\;matrix\;with\;main\;diagonal\;D. \end{eqnarray*}
\begin{eqnarray*} \hspace{-2em} \hspace{-2em} \hspace{-2em} \hspace{-2em} \hspace{-2em} U \times U^{T} = V \times V^{T} = I \qquad where\;I\;is\;Identity\;matrix\\. \end{eqnarray*}
Data Structures | |
| struct | DSPLIB_svd_small_InitArgs |
| Structure containing the parameters to initialize the kernel. More... | |
Functions | |
| int32_t | DSPLIB_svd_small_getHandleSize (DSPLIB_svd_small_InitArgs *pKerInitArgs) |
| This is a query function to calculate the size of internal handle. More... | |
| DSPLIB_STATUS | DSPLIB_svd_small_init_checkParams (DSPLIB_kernelHandle handle, const DSPLIB_bufParams2D_t *bufParamsA, const DSPLIB_bufParams2D_t *bufParamsU, const DSPLIB_bufParams2D_t *bufParamsV, const DSPLIB_bufParams1D_t *bufParamsDiag, const DSPLIB_bufParams1D_t *bufParamsSuperDiag, const DSPLIB_svd_small_InitArgs *pKerInitArgs) |
| This function checks the validity of the parameters passed to DSPLIB_svd_small_init function. This function is called with the same parameters as the DSPLIB_svd_small_init, and this function must be called before the DSPLIB_svd_small_init is called. More... | |
| DSPLIB_STATUS | DSPLIB_svd_small_init (DSPLIB_kernelHandle handle, const DSPLIB_bufParams2D_t *bufParamsA, const DSPLIB_bufParams2D_t *bufParamsU, const DSPLIB_bufParams2D_t *bufParamsV, const DSPLIB_bufParams1D_t *bufParamsDiag, const DSPLIB_bufParams1D_t *bufParamsSuperDiag, const DSPLIB_svd_small_InitArgs *pKerInitArgs) |
| This function should be called before the DSPLIB_svd_small_exec function is called. This function takes care of any one-time operations such as setting up the configuration of required hardware resources such as the streaming engine and streaming address generator. The results of these operations are stored in the handle. More... | |
| DSPLIB_STATUS | DSPLIB_svd_small_exec_checkParams (DSPLIB_kernelHandle handle, const void *restrict pA, const void *restrict pU, const void *restrict pV, const void *restrict pDiag, const void *restrict pSuperDiag, const void *restrict pU1) |
| This function checks the validity of the parameters passed to DSPLIB_svd_small_exec function. This function is called with the same parameters as the DSPLIB_svd_small_exec, and this function must be called before the DSPLIB_svd_small_exec is called. More... | |
| DSPLIB_STATUS | DSPLIB_svd_small_exec (DSPLIB_kernelHandle handle, void *restrict pA, void *restrict pU, void *restrict pV, void *restrict pDiag, void *restrict pSuperDiag, void *restrict pU1) |
| This function is the main kernel compute function. More... | |
| int32_t DSPLIB_svd_small_getHandleSize | ( | DSPLIB_svd_small_InitArgs * | pKerInitArgs | ) |
This is a query function to calculate the size of internal handle.
| [in] | pKerInitArgs | : Pointer to structure holding init parameters |
Definition at line 25 of file DSPLIB_svd_small.cpp.
| DSPLIB_STATUS DSPLIB_svd_small_init_checkParams | ( | DSPLIB_kernelHandle | handle, |
| const DSPLIB_bufParams2D_t * | bufParamsA, | ||
| const DSPLIB_bufParams2D_t * | bufParamsU, | ||
| const DSPLIB_bufParams2D_t * | bufParamsV, | ||
| const DSPLIB_bufParams1D_t * | bufParamsDiag, | ||
| const DSPLIB_bufParams1D_t * | bufParamsSuperDiag, | ||
| const DSPLIB_svd_small_InitArgs * | pKerInitArgs | ||
| ) |
This function checks the validity of the parameters passed to DSPLIB_svd_small_init function. This function is called with the same parameters as the DSPLIB_svd_small_init, and this function must be called before the DSPLIB_svd_small_init is called.
| [in] | handle | : Active handle to the kernel |
| [in] | bufParamsA | : Pointer to the structure containing dimensional information of input buffer A |
| [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 |
Definition at line 34 of file DSPLIB_svd_small.cpp.
| DSPLIB_STATUS DSPLIB_svd_small_init | ( | DSPLIB_kernelHandle | handle, |
| const DSPLIB_bufParams2D_t * | bufParamsA, | ||
| const DSPLIB_bufParams2D_t * | bufParamsU, | ||
| const DSPLIB_bufParams2D_t * | bufParamsV, | ||
| const DSPLIB_bufParams1D_t * | bufParamsDiag, | ||
| const DSPLIB_bufParams1D_t * | bufParamsSuperDiag, | ||
| const DSPLIB_svd_small_InitArgs * | pKerInitArgs | ||
| ) |
This function should be called before the DSPLIB_svd_small_exec function is called. This function takes care of any one-time operations such as setting up the configuration of required hardware resources such as the streaming engine and streaming address generator. The results of these operations are stored in the handle.
| [in] | handle | : Active handle to the kernel |
| [in] | bufParamsA | : Pointer to the structure containing dimensional information of input buffer A |
| [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 |
Definition at line 122 of file DSPLIB_svd_small.cpp.
| DSPLIB_STATUS DSPLIB_svd_small_exec_checkParams | ( | DSPLIB_kernelHandle | handle, |
| const void *restrict | pA, | ||
| const void *restrict | pU, | ||
| const void *restrict | pV, | ||
| const void *restrict | pDiag, | ||
| const void *restrict | pSuperDiag, | ||
| const void *restrict | pU1 | ||
| ) |
This function checks the validity of the parameters passed to DSPLIB_svd_small_exec function. This function is called with the same parameters as the DSPLIB_svd_small_exec, and this function must be called before the DSPLIB_svd_small_exec is called.
| [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 intermediate transpose buffer pU1 |
| [in] | pV1 | : Pointer to the intermediate transpose buffer pV1 |
| [out] | pScratch | : Pointer to the intermediate scratch buffer pScratch |
Definition at line 92 of file DSPLIB_svd_small.cpp.
| DSPLIB_STATUS DSPLIB_svd_small_exec | ( | DSPLIB_kernelHandle | handle, |
| void *restrict | pA, | ||
| void *restrict | pU, | ||
| void *restrict | pV, | ||
| void *restrict | pDiag, | ||
| void *restrict | pSuperDiag, | ||
| void *restrict | pU1 | ||
| ) |
This function is the main kernel compute function.
Please refer to details under DSPLIB_svd_small_exec
| [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 intermediate transpose buffer pU1 |
| Buffer | dimY | dimX | Comments |
|---|---|---|---|
| pA | M | N | Input Matrix |
| pU | max(M,N) | max(M,N) | Output Matrix |
| pV | N | N | Output Matrix |
| pDiag | 1 | min(M,N) | Output Vector |
| pSuperDiag | 1 | min(M,N) | Intermediate Vector |
| pU1 | max(M,N) | max(M,N) | Scratch buffer to store transpose of U |
Definition at line 191 of file DSPLIB_svd_small.cpp.