MAGMA
2.3.0
Matrix Algebra for GPU and Multicore Architectures

Functions  
magma_int_t  magma_chesv (magma_uplo_t uplo, magma_int_t n, magma_int_t nrhs, magmaFloatComplex *A, magma_int_t lda, magma_int_t *ipiv, magmaFloatComplex *B, magma_int_t ldb, magma_int_t *info) 
CHESV computes the solution to a complex system of linear equations A * X = B, where A is an nbyn Hermitian matrix and X and B are nbynrhs matrices. More...  
magma_int_t  magma_dssysv_gpu (magma_uplo_t uplo, magma_int_t n, magma_int_t nrhs, magmaDouble_ptr dA, magma_int_t ldda, magmaDouble_ptr dB, magma_int_t lddb, magmaDouble_ptr dX, magma_int_t lddx, magmaDouble_ptr dworkd, magmaFloat_ptr dworks, magma_int_t *iter, magma_int_t *info) 
DSHESV computes the solution to a real system of linear equations A * X = B, where A is an NbyN symmetric matrix and X and B are NbyNRHS matrices. More...  
magma_int_t  magma_dsysv (magma_uplo_t uplo, magma_int_t n, magma_int_t nrhs, double *A, magma_int_t lda, magma_int_t *ipiv, double *B, magma_int_t ldb, magma_int_t *info) 
DSYSV computes the solution to a real system of linear equations A * X = B, where A is an nbyn symmetric matrix and X and B are nbynrhs matrices. More...  
magma_int_t  magma_ssysv (magma_uplo_t uplo, magma_int_t n, magma_int_t nrhs, float *A, magma_int_t lda, magma_int_t *ipiv, float *B, magma_int_t ldb, magma_int_t *info) 
SSYSV computes the solution to a real system of linear equations A * X = B, where A is an nbyn symmetric matrix and X and B are nbynrhs matrices. More...  
magma_int_t  magma_zchesv_gpu (magma_uplo_t uplo, magma_int_t n, magma_int_t nrhs, magmaDoubleComplex_ptr dA, magma_int_t ldda, magmaDoubleComplex_ptr dB, magma_int_t lddb, magmaDoubleComplex_ptr dX, magma_int_t lddx, magmaDoubleComplex_ptr dworkd, magmaFloatComplex_ptr dworks, magma_int_t *iter, magma_int_t *info) 
ZCHESV computes the solution to a complex system of linear equations A * X = B, where A is an NbyN Hermitian matrix and X and B are NbyNRHS matrices. More...  
magma_int_t  magma_zhesv (magma_uplo_t uplo, magma_int_t n, magma_int_t nrhs, magmaDoubleComplex *A, magma_int_t lda, magma_int_t *ipiv, magmaDoubleComplex *B, magma_int_t ldb, magma_int_t *info) 
ZHESV computes the solution to a complex system of linear equations A * X = B, where A is an nbyn Hermitian matrix and X and B are nbynrhs matrices. More...  
magma_int_t magma_chesv  (  magma_uplo_t  uplo, 
magma_int_t  n,  
magma_int_t  nrhs,  
magmaFloatComplex *  A,  
magma_int_t  lda,  
magma_int_t *  ipiv,  
magmaFloatComplex *  B,  
magma_int_t  ldb,  
magma_int_t *  info  
) 
CHESV computes the solution to a complex system of linear equations A * X = B, where A is an nbyn Hermitian matrix and X and B are nbynrhs matrices.
The diagonal pivoting method is used to factor A as A = U * D * U**H, if uplo = MagmaUpper, or A = L * D * L**H, if uplo = MagmaLower, where U (or L) is a product of permutation and unit upper (lower) triangular matrices, and D is Hermitian and block diagonal with 1by1 and 2by2 diagonal blocks. The factored form of A is then used to solve the system of equations A * X = B.
[in]  uplo  magma_uplo_t = MagmaUpper: Upper triangle of A is stored; = MagmaLower: Lower triangle of A is stored. 
[in]  n  INTEGER The number of linear equations, i.e., the order of the matrix A. n >= 0. 
[in]  nrhs  INTEGER The number of right hand sides, i.e., the number of columns of the matrix B. nrhs >= 0. 
[in,out]  A  COMPLEX array, dimension (lda,n) On entry, the Hermitian matrix A. If uplo = MagmaUpper, the leading nbyn upper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced. If uplo = MagmaLower, the leading nbyn lower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced. 
On exit, if info = 0, the block diagonal matrix D and the multipliers used to obtain the factor U or L from the factorization A = U*D*U**H or A = L*D*L**H as computed by CHETRF.
[in]  lda  INTEGER The leading dimension of the array A. lda >= max(1,n). 
[out]  ipiv  INTEGER array, dimension (n) Details of the interchanges and the block structure of D, as determined by CHETRF. If ipiv(k) > 0, then rows and columns k and ipiv(k) were interchanged, and D(k,k) is a 1by1 diagonal block. If uplo = MagmaUpper and ipiv(k) = ipiv(k1) < 0, then rows and columns k1 and ipiv(k) were interchanged and D(k1:k,k1:k) is a 2by2 diagonal block. If uplo = MagmaLower and ipiv(k) = ipiv(k+1) < 0, then rows and columns k+1 and ipiv(k) were interchanged and D(k:k+1,k:k+1) is a 2by2 diagonal block. 
[in,out]  B  (input/output) COMPLEX array, dimension (ldb,nrhs) On entry, the nbynrhs right hand side matrix B. On exit, if info = 0, the nbynrhs solution matrix X. 
[in]  ldb  INTEGER The leading dimension of the array B. ldb >= max(1,n). 
[out]  info  INTEGER = 0: successful exit < 0: if info = i, the ith argument had an illegal value > 0: if info = i, D(i,i) is exactly zero. The factorization has been completed, but the block diagonal matrix D is exactly singular, so the solution could not be computed. 
magma_int_t magma_dssysv_gpu  (  magma_uplo_t  uplo, 
magma_int_t  n,  
magma_int_t  nrhs,  
magmaDouble_ptr  dA,  
magma_int_t  ldda,  
magmaDouble_ptr  dB,  
magma_int_t  lddb,  
magmaDouble_ptr  dX,  
magma_int_t  lddx,  
magmaDouble_ptr  dworkd,  
magmaFloat_ptr  dworks,  
magma_int_t *  iter,  
magma_int_t *  info  
) 
DSHESV computes the solution to a real system of linear equations A * X = B, where A is an NbyN symmetric matrix and X and B are NbyNRHS matrices.
DSHESV first attempts to factorize the matrix in real SINGLE PRECISION (without pivoting) and use this factorization within iterative refinements to produce a solution with real DOUBLE PRECISION normwise backward error quality (see below). If the approach fails the method switches to a real DOUBLE PRECISION factorization and solve.
The iterative refinement is not going to be a winning strategy if the ratio real SINGLE PRECISION performance over real DOUBLE PRECISION performance is too small or if there are many righthand sides. A reasonable strategy should take the number of righthand sides and the size of the matrix into account. This might be done with a call to ILAENV in the future. For now, we always try iterative refinement.
The iterative refinement process is stopped if ITER > ITERMAX or for all the RHS we have: RNRM < SQRT(N)*XNRM*ANRM*EPS*BWDMAX where o ITER is the number of the current iteration in the iterative refinement process o RNRM is the infinitynorm of the residual o XNRM is the infinitynorm of the solution o ANRM is the infinityoperatornorm of the matrix A o EPS is the machine epsilon returned by DLAMCH('Epsilon') The value ITERMAX and BWDMAX are fixed to 30 and 1.0D+00 respectively.
[in]  uplo  magma_uplo_t

[in]  n  INTEGER The number of linear equations, i.e., the order of the matrix A. N >= 0. 
[in]  nrhs  INTEGER The number of right hand sides, i.e., the number of columns of the matrix B. NRHS >= 0. 
[in,out]  dA  DOUBLE PRECISION array on the GPU, dimension (LDDA,N) On entry, the symmetric matrix A. If UPLO = MagmaUpper, the leading NbyN upper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced. If UPLO = MagmaLower, the leading NbyN lower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced. On exit, if iterative refinement has been successfully used (INFO.EQ.0 and ITER.GE.0, see description below), then A is unchanged, if double factorization has been used (INFO.EQ.0 and ITER.LT.0, see description below), then the array dA contains the factor U or L from the Cholesky factorization A = U**T*U or A = L*L**T. 
[in]  ldda  INTEGER The leading dimension of the array dA. LDDA >= max(1,N). 
[in]  dB  DOUBLE PRECISION array on the GPU, dimension (LDDB,NRHS) The NbyNRHS right hand side matrix B. 
[in]  lddb  INTEGER The leading dimension of the array dB. LDDB >= max(1,N). 
[out]  dX  DOUBLE PRECISION array on the GPU, dimension (LDDX,NRHS) If INFO = 0, the NbyNRHS solution matrix X. 
[in]  lddx  INTEGER The leading dimension of the array dX. LDDX >= max(1,N). 
dworkd  (workspace) DOUBLE PRECISION array on the GPU, dimension (N*NRHS) This array is used to hold the residual vectors.  
dworks  (workspace) SINGLE PRECISION array on the GPU, dimension (N*(N+NRHS)) This array is used to store the real single precision matrix and the righthand sides or solutions in single precision.  
[out]  iter  INTEGER

[out]  info  INTEGER

magma_int_t magma_dsysv  (  magma_uplo_t  uplo, 
magma_int_t  n,  
magma_int_t  nrhs,  
double *  A,  
magma_int_t  lda,  
magma_int_t *  ipiv,  
double *  B,  
magma_int_t  ldb,  
magma_int_t *  info  
) 
DSYSV computes the solution to a real system of linear equations A * X = B, where A is an nbyn symmetric matrix and X and B are nbynrhs matrices.
The diagonal pivoting method is used to factor A as A = U * D * U**H, if uplo = MagmaUpper, or A = L * D * L**H, if uplo = MagmaLower, where U (or L) is a product of permutation and unit upper (lower) triangular matrices, and D is symmetric and block diagonal with 1by1 and 2by2 diagonal blocks. The factored form of A is then used to solve the system of equations A * X = B.
[in]  uplo  magma_uplo_t = MagmaUpper: Upper triangle of A is stored; = MagmaLower: Lower triangle of A is stored. 
[in]  n  INTEGER The number of linear equations, i.e., the order of the matrix A. n >= 0. 
[in]  nrhs  INTEGER The number of right hand sides, i.e., the number of columns of the matrix B. nrhs >= 0. 
[in,out]  A  DOUBLE PRECISION array, dimension (lda,n) On entry, the symmetric matrix A. If uplo = MagmaUpper, the leading nbyn upper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced. If uplo = MagmaLower, the leading nbyn lower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced. 
On exit, if info = 0, the block diagonal matrix D and the multipliers used to obtain the factor U or L from the factorization A = U*D*U**H or A = L*D*L**H as computed by DSYTRF.
[in]  lda  INTEGER The leading dimension of the array A. lda >= max(1,n). 
[out]  ipiv  INTEGER array, dimension (n) Details of the interchanges and the block structure of D, as determined by DSYTRF. If ipiv(k) > 0, then rows and columns k and ipiv(k) were interchanged, and D(k,k) is a 1by1 diagonal block. If uplo = MagmaUpper and ipiv(k) = ipiv(k1) < 0, then rows and columns k1 and ipiv(k) were interchanged and D(k1:k,k1:k) is a 2by2 diagonal block. If uplo = MagmaLower and ipiv(k) = ipiv(k+1) < 0, then rows and columns k+1 and ipiv(k) were interchanged and D(k:k+1,k:k+1) is a 2by2 diagonal block. 
[in,out]  B  (input/output) DOUBLE PRECISION array, dimension (ldb,nrhs) On entry, the nbynrhs right hand side matrix B. On exit, if info = 0, the nbynrhs solution matrix X. 
[in]  ldb  INTEGER The leading dimension of the array B. ldb >= max(1,n). 
[out]  info  INTEGER = 0: successful exit < 0: if info = i, the ith argument had an illegal value > 0: if info = i, D(i,i) is exactly zero. The factorization has been completed, but the block diagonal matrix D is exactly singular, so the solution could not be computed. 
magma_int_t magma_ssysv  (  magma_uplo_t  uplo, 
magma_int_t  n,  
magma_int_t  nrhs,  
float *  A,  
magma_int_t  lda,  
magma_int_t *  ipiv,  
float *  B,  
magma_int_t  ldb,  
magma_int_t *  info  
) 
SSYSV computes the solution to a real system of linear equations A * X = B, where A is an nbyn symmetric matrix and X and B are nbynrhs matrices.
The diagonal pivoting method is used to factor A as A = U * D * U**H, if uplo = MagmaUpper, or A = L * D * L**H, if uplo = MagmaLower, where U (or L) is a product of permutation and unit upper (lower) triangular matrices, and D is symmetric and block diagonal with 1by1 and 2by2 diagonal blocks. The factored form of A is then used to solve the system of equations A * X = B.
[in]  uplo  magma_uplo_t = MagmaUpper: Upper triangle of A is stored; = MagmaLower: Lower triangle of A is stored. 
[in]  n  INTEGER The number of linear equations, i.e., the order of the matrix A. n >= 0. 
[in]  nrhs  INTEGER The number of right hand sides, i.e., the number of columns of the matrix B. nrhs >= 0. 
[in,out]  A  REAL array, dimension (lda,n) On entry, the symmetric matrix A. If uplo = MagmaUpper, the leading nbyn upper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced. If uplo = MagmaLower, the leading nbyn lower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced. 
On exit, if info = 0, the block diagonal matrix D and the multipliers used to obtain the factor U or L from the factorization A = U*D*U**H or A = L*D*L**H as computed by SSYTRF.
[in]  lda  INTEGER The leading dimension of the array A. lda >= max(1,n). 
[out]  ipiv  INTEGER array, dimension (n) Details of the interchanges and the block structure of D, as determined by SSYTRF. If ipiv(k) > 0, then rows and columns k and ipiv(k) were interchanged, and D(k,k) is a 1by1 diagonal block. If uplo = MagmaUpper and ipiv(k) = ipiv(k1) < 0, then rows and columns k1 and ipiv(k) were interchanged and D(k1:k,k1:k) is a 2by2 diagonal block. If uplo = MagmaLower and ipiv(k) = ipiv(k+1) < 0, then rows and columns k+1 and ipiv(k) were interchanged and D(k:k+1,k:k+1) is a 2by2 diagonal block. 
[in,out]  B  (input/output) REAL array, dimension (ldb,nrhs) On entry, the nbynrhs right hand side matrix B. On exit, if info = 0, the nbynrhs solution matrix X. 
[in]  ldb  INTEGER The leading dimension of the array B. ldb >= max(1,n). 
[out]  info  INTEGER = 0: successful exit < 0: if info = i, the ith argument had an illegal value > 0: if info = i, D(i,i) is exactly zero. The factorization has been completed, but the block diagonal matrix D is exactly singular, so the solution could not be computed. 
magma_int_t magma_zchesv_gpu  (  magma_uplo_t  uplo, 
magma_int_t  n,  
magma_int_t  nrhs,  
magmaDoubleComplex_ptr  dA,  
magma_int_t  ldda,  
magmaDoubleComplex_ptr  dB,  
magma_int_t  lddb,  
magmaDoubleComplex_ptr  dX,  
magma_int_t  lddx,  
magmaDoubleComplex_ptr  dworkd,  
magmaFloatComplex_ptr  dworks,  
magma_int_t *  iter,  
magma_int_t *  info  
) 
ZCHESV computes the solution to a complex system of linear equations A * X = B, where A is an NbyN Hermitian matrix and X and B are NbyNRHS matrices.
ZCHESV first attempts to factorize the matrix in complex SINGLE PRECISION (without pivoting) and use this factorization within iterative refinements to produce a solution with complex DOUBLE PRECISION normwise backward error quality (see below). If the approach fails the method switches to a complex DOUBLE PRECISION factorization and solve.
The iterative refinement is not going to be a winning strategy if the ratio complex SINGLE PRECISION performance over complex DOUBLE PRECISION performance is too small or if there are many righthand sides. A reasonable strategy should take the number of righthand sides and the size of the matrix into account. This might be done with a call to ILAENV in the future. For now, we always try iterative refinement.
The iterative refinement process is stopped if ITER > ITERMAX or for all the RHS we have: RNRM < SQRT(N)*XNRM*ANRM*EPS*BWDMAX where o ITER is the number of the current iteration in the iterative refinement process o RNRM is the infinitynorm of the residual o XNRM is the infinitynorm of the solution o ANRM is the infinityoperatornorm of the matrix A o EPS is the machine epsilon returned by DLAMCH('Epsilon') The value ITERMAX and BWDMAX are fixed to 30 and 1.0D+00 respectively.
[in]  uplo  magma_uplo_t

[in]  n  INTEGER The number of linear equations, i.e., the order of the matrix A. N >= 0. 
[in]  nrhs  INTEGER The number of right hand sides, i.e., the number of columns of the matrix B. NRHS >= 0. 
[in,out]  dA  COMPLEX_16 array on the GPU, dimension (LDDA,N) On entry, the Hermitian matrix A. If UPLO = MagmaUpper, the leading NbyN upper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced. If UPLO = MagmaLower, the leading NbyN lower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced. On exit, if iterative refinement has been successfully used (INFO.EQ.0 and ITER.GE.0, see description below), then A is unchanged, if double factorization has been used (INFO.EQ.0 and ITER.LT.0, see description below), then the array dA contains the factor U or L from the Cholesky factorization A = U**T*U or A = L*L**T. 
[in]  ldda  INTEGER The leading dimension of the array dA. LDDA >= max(1,N). 
[in]  dB  COMPLEX_16 array on the GPU, dimension (LDDB,NRHS) The NbyNRHS right hand side matrix B. 
[in]  lddb  INTEGER The leading dimension of the array dB. LDDB >= max(1,N). 
[out]  dX  COMPLEX_16 array on the GPU, dimension (LDDX,NRHS) If INFO = 0, the NbyNRHS solution matrix X. 
[in]  lddx  INTEGER The leading dimension of the array dX. LDDX >= max(1,N). 
dworkd  (workspace) COMPLEX_16 array on the GPU, dimension (N*NRHS) This array is used to hold the residual vectors.  
dworks  (workspace) COMPLEX array on the GPU, dimension (N*(N+NRHS)) This array is used to store the complex single precision matrix and the righthand sides or solutions in single precision.  
[out]  iter  INTEGER

[out]  info  INTEGER

magma_int_t magma_zhesv  (  magma_uplo_t  uplo, 
magma_int_t  n,  
magma_int_t  nrhs,  
magmaDoubleComplex *  A,  
magma_int_t  lda,  
magma_int_t *  ipiv,  
magmaDoubleComplex *  B,  
magma_int_t  ldb,  
magma_int_t *  info  
) 
ZHESV computes the solution to a complex system of linear equations A * X = B, where A is an nbyn Hermitian matrix and X and B are nbynrhs matrices.
The diagonal pivoting method is used to factor A as A = U * D * U**H, if uplo = MagmaUpper, or A = L * D * L**H, if uplo = MagmaLower, where U (or L) is a product of permutation and unit upper (lower) triangular matrices, and D is Hermitian and block diagonal with 1by1 and 2by2 diagonal blocks. The factored form of A is then used to solve the system of equations A * X = B.
[in]  uplo  magma_uplo_t = MagmaUpper: Upper triangle of A is stored; = MagmaLower: Lower triangle of A is stored. 
[in]  n  INTEGER The number of linear equations, i.e., the order of the matrix A. n >= 0. 
[in]  nrhs  INTEGER The number of right hand sides, i.e., the number of columns of the matrix B. nrhs >= 0. 
[in,out]  A  COMPLEX*16 array, dimension (lda,n) On entry, the Hermitian matrix A. If uplo = MagmaUpper, the leading nbyn upper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced. If uplo = MagmaLower, the leading nbyn lower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced. 
On exit, if info = 0, the block diagonal matrix D and the multipliers used to obtain the factor U or L from the factorization A = U*D*U**H or A = L*D*L**H as computed by ZHETRF.
[in]  lda  INTEGER The leading dimension of the array A. lda >= max(1,n). 
[out]  ipiv  INTEGER array, dimension (n) Details of the interchanges and the block structure of D, as determined by ZHETRF. If ipiv(k) > 0, then rows and columns k and ipiv(k) were interchanged, and D(k,k) is a 1by1 diagonal block. If uplo = MagmaUpper and ipiv(k) = ipiv(k1) < 0, then rows and columns k1 and ipiv(k) were interchanged and D(k1:k,k1:k) is a 2by2 diagonal block. If uplo = MagmaLower and ipiv(k) = ipiv(k+1) < 0, then rows and columns k+1 and ipiv(k) were interchanged and D(k:k+1,k:k+1) is a 2by2 diagonal block. 
[in,out]  B  (input/output) COMPLEX*16 array, dimension (ldb,nrhs) On entry, the nbynrhs right hand side matrix B. On exit, if info = 0, the nbynrhs solution matrix X. 
[in]  ldb  INTEGER The leading dimension of the array B. ldb >= max(1,n). 
[out]  info  INTEGER = 0: successful exit < 0: if info = i, the ith argument had an illegal value > 0: if info = i, D(i,i) is exactly zero. The factorization has been completed, but the block diagonal matrix D is exactly singular, so the solution could not be computed. 