rocsolver_sgesvdj_batched Interface Reference

rocsolver_sgesvdj_batched Interface Reference#

HIPFORT API Reference: hipfort_rocsolver::rocsolver_sgesvdj_batched Interface Reference
hipfort_rocsolver::rocsolver_sgesvdj_batched Interface Reference

The GESVDJ_BATCHED functions compute the singular values and optionally the singular vectors of a batch of general m-by-n matrices A (Singular Value Decomposition). More...

Public Member Functions

integer(kind(rocblas_status_success)) function rocsolver_sgesvdj_batched_ (handle, left_svect, right_svect, m, n, a, lda, abstol, residual, max_sweeps, n_sweeps, s, strides, u, ldu, strideu, v, ldv, stridev, myinfo, batch_count)
 

Detailed Description

The GESVDJ_BATCHED functions compute the singular values and optionally the singular vectors of a batch of general m-by-n matrices A (Singular Value Decomposition).

The SVD of matrix A_l in the batch is given by:

\[ A_l = U_l S_l V_l^H \]

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

The computation of the singular vectors is optional and 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, that is, the rows of \(V_l^H\).

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

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

The singular values are computed by applying QR factorization to \(A_lV_l\) if m >= n (resp. LQ factorization to \(U_l^H A_l\) if m < n ), where \(V_l\) (resp. \(U_l\)) is found as the eigenvectors of \(A_l^H A_l\) (resp. \(A_l A_l^H\)) using the Jacobi eigenvalue algorithm.

Note
In order to carry out calculations, this method could potentially synchronize the stream contained within the rocblas_handle.
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 all matrices A_l in the batch.
[in]n- rocblas_int. n >= 0. The number of columns of all matrices A_l in the batch.
[in,out]A- Array of pointers to type. Each pointer points to an array on the GPU of dimension lda*n. On entry, the matrices A_l. On exit, the contents of A_l are destroyed.
[in]lda- rocblas_int. lda >= m. The leading dimension of A_l.
[in]abstol- real type. The absolute tolerance. The algorithm is considered to have converged once \(\mathrm{off}(A_l^H A_l) ≤ \mathrm{norm}(A_l^H A_l) \cdot \mathrm{abstol}\) [resp. \(\mathrm{off}(A_l A_l^H) ≤ \mathrm{norm}(A_l A_l^H) \cdot \mathrm{abstol}\)]. If abstol <= 0, then the tolerance will be set to machine precision.
[out]residual- pointer to real type on the GPU. The Frobenius norm of the off-diagonal elements of \(A_l^H A_l\) (resp. \(A_l A_l^H\)) at the final iteration.
[in]max_sweeps- rocblas_int. max_sweeps > 0. Maximum number of sweeps (iterations) to be used by the algorithm.
[out]n_sweeps- pointer to rocblas_int. Array of batch_count integers on the GPU. The actual number of sweeps (iterations) used by the algorithm for each batch instance.
[out]S- pointer to real type. Array on the GPU (the size depends on the value of strideS). The singular values of A_l in decreasing order.
[in]strideS- rocblas_stride. Stride from the start of one vector S_l to the next one S(l+1). There is no restriction for the value of strideS. The normal use case is strideS >= min(m,n).
[out]U- pointer to type. Array on the GPU (the side depends on the value of strideU). The matrices U_l 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, and ldu >= 1 otherwise. The leading dimension of U_l.
[in]strideU- rocblas_stride. Stride from the start of one matrix U_l to the next one U(l+1). There is no restriction for the value of strideU. The normal use case is strideU >= ldu*min(m,n) if left_svect is set to singular, or strideU >= ldu*m when left_svect is equal to all.
[out]V- pointer to type. Array on the GPU (the size depends on the value of strideV). The matrices V_l 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, and ldv >= min(m,n) if right_svect is set to singular, or ldv >= 1 otherwise. The leading dimension of V.
[in]strideV- rocblas_stride. Stride from the start of one matrix V_l to the next one V(l+1). There is no restriction for the value of strideV. The normal use case is strideV >= ldv*n.
[out]myInfo- pointer to a rocblas_int on the GPU. If info[l] = 0, successful exit. If info[l] = 1, the algorithm did not converge.
[in]batch_count- rocblas_int. batch_count >= 0. Number of matrices in the batch.

Member Function/Subroutine Documentation

◆ rocsolver_sgesvdj_batched_()

integer(kind(rocblas_status_success)) function hipfort_rocsolver::rocsolver_sgesvdj_batched::rocsolver_sgesvdj_batched_ ( 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,
real(c_float), value  abstol,
type(c_ptr), value  residual,
integer(c_int), value  max_sweeps,
type(c_ptr), value  n_sweeps,
type(c_ptr), value  s,
integer(c_int64_t), value  strides,
type(c_ptr), value  u,
integer(c_int), value  ldu,
integer(c_int64_t), value  strideu,
type(c_ptr), value  v,
integer(c_int), value  ldv,
integer(c_int64_t), value  stridev,
type(c_ptr), value  myinfo,
integer(c_int), value  batch_count 
)

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