rocsolver_sgesdd Interface Reference

rocsolver_sgesdd Interface Reference#

HIPFORT API Reference: hipfort_rocsolver::rocsolver_sgesdd Interface Reference
hipfort_rocsolver::rocsolver_sgesdd Interface Reference

GESDD computes the singular values and optionally the singular vectors of a general m-by-n matrix A (Singular Value Decomposition). More...

Public Member Functions

integer(kind(rocblas_status_success)) function rocsolver_sgesdd_ (handle, left_svect, right_svect, m, n, a, lda, s, u, ldu, v, ldv, myinfo)
 

Detailed Description

GESDD computes the singular values and optionally the singular vectors of a general m-by-n matrix A (Singular Value Decomposition).

The SVD of matrix A is given by:

\[ A = U S V^H \]

where the m-by-n matrix S is zero except, possibly, for its min(m,n) diagonal elements, which are the singular values of A. U and V are orthogonal (unitary) matrices. The first min(m,n) columns of U and V are the left and right singular vectors of A, respectively.

The computation of the singular vectors is optional and it is controlled by the function arguments left_svect and right_svect as described below. When computed, this function returns the transpose (or transpose conjugate) of the right singular vectors, i.e. the rows of \(V^H\).

left_svect and right_svect are rocblas_svect enums that can take the following values:

  • rocblas_svect_all: the entire matrix U (or \(V^H\)) is computed,
  • rocblas_svect_singular: the singular vectors (first min(m,n) columns of U or rows of \(V^H\)) are computed, or
  • rocblas_svect_none: no columns (or rows) of U (or \(V^H\)) are computed, i.e. no singular vectors.

The singular values are computed by applying QR factorization to \(AV\) if \(m ≥ n\) (resp. LQ factorization to \(U^H A\) if \(m < n\)), where \(V\) (resp. \(U\)) is found as the eigenvectors of \(A^H A\) (resp. \(A A^H\)) using the Divide-and-Conquer eigensolver.

Parameters
[in]handle- rocblas_handle.
[in]left_svect- rocblas_svect. Specifies how the left singular vectors are computed. rocblas_svect_overwrite is not supported.
[in]right_svect- rocblas_svect. Specifies how the right singular vectors are computed. rocblas_svect_overwrite is not supported.
[in]m- rocblas_int. m >= 0. The number of rows of matrix A.
[in]n- rocblas_int. n >= 0. The number of columns of matrix A.
[in,out]A- pointer to type. Array on the GPU of dimension lda*n. On entry, the matrix A. On exit, the contents of A are destroyed.
[in]lda- rocblas_int. lda >= m. The leading dimension of A.
[out]S- pointer to real type. Array on the GPU of dimension min(m,n). The singular values of A in decreasing order.
[out]U- pointer to type. Array on the GPU of dimension ldu*min(m,n) if left_svect is set to singular, or ldu*m when left_svect is equal to all. The matrix of left singular vectors stored as columns. Not referenced if left_svect is set to none.
[in]ldu- rocblas_int. ldu >= m if left_svect is set to all or singular; ldu >= 1 otherwise. The leading dimension of U.
[out]V- pointer to type. Array on the GPU of dimension ldv*n. The matrix of right singular vectors stored as rows (transposed / conjugate-transposed). Not referenced if right_svect is set to none.
[in]ldv- rocblas_int. ldv >= n if right_svect is set to all; ldv >= min(m,n) if right_svect is set to singular; or ldv >= 1 otherwise. The leading dimension of V.
[out]myInfo- pointer to a rocblas_int on the GPU. If info = 0, successful exit. If info = 1, the algorithm did not converge.

Member Function/Subroutine Documentation

◆ rocsolver_sgesdd_()

integer(kind(rocblas_status_success)) function hipfort_rocsolver::rocsolver_sgesdd::rocsolver_sgesdd_ ( type(c_ptr), value  handle,
integer(kind(rocblas_svect_all)), value  left_svect,
integer(kind(rocblas_svect_all)), value  right_svect,
integer(c_int), value  m,
integer(c_int), value  n,
type(c_ptr), value  a,
integer(c_int), value  lda,
type(c_ptr), value  s,
type(c_ptr), value  u,
integer(c_int), value  ldu,
type(c_ptr), value  v,
integer(c_int), value  ldv,
type(c_ptr), value  myinfo 
)

The documentation for this interface was generated from the following file: