Singular Value Decomposition For General Matrices#

GESVD (GEneral Singular Value Decomposition) computes the singular values from the SVD of batched general matrices using the QR algorithm.

\[A = U * \Sigma * V^H\]

where

  • A is a (M x N) general matrix,

  • \(\Sigma\) is a (M x N) diagonal matrix which is zero except for its min(M, N) diagonal elements, containing the singular values of A in descending order (the singular values are always real and non-negative),

  • U is a (M x M) unitary matrix containing the left singular vectors of A, and

  • V^H is a (N x N) unitary matrix representing the conjugate transpose of V, containing the right singular vectors of A.

Warning

cuSolverDx’s gesvd functions only support computing the singular values in the current release. Support for the right/left singular vectors will be added in a future release.

cuSolverDx gesvd device functions are as follows (see Execution Methods):

// Compute singular values only
__device__ void execute(data_type* A, precision_of_data_type* S, data_type* workspace, status_type* info);
// Compute singular values only with runtime lda
__device__ void execute(data_type* A, const unsigned int lda, precision_of_data_type* S, data_type* workspace, status_type* info);

Singular values of a general matrix are always real and non-negative values, which is why in the gesvd functions S is of precision_of_data_type* instead of data_type*. The array S is of size min(M, N) for each batch, and contains the singular values of A in descending order on exit.

A is a batched M x N matrix, with leading dimension lda >= M if A is in column-major layout, or lda >= N if A is row-major. cuSolverDx’s gesvd functions support both M >= N and M < N cases.

  • If only singular values are requested, i.e., job::no_vectors is selected, on exit the content of A is destroyed, and S is filled with the singular values.

The array workspace is a temporary buffer space, required to be preallocated by the user. The size of the buffer can be obtained by workspace_size.

The function returns status info for each batch:

  • info = 0: The function completed successfully.

  • info = i > 0: The algorithm did not converge. Specifically, i off-diagonal elements did not converge to zero.

The function supports:

  1. A can be either column- or row-major layouts, see Arrangement operator.