Skip to main content

cusolverDnXgetrs

Function cusolverDnXgetrs 

Source
pub unsafe extern "C" fn cusolverDnXgetrs(
    handle: cusolverDnHandle_t,
    params: cusolverDnParams_t,
    trans: cublasOperation_t,
    n: i64,
    nrhs: i64,
    dataTypeA: cudaDataType,
    A: *const c_void,
    lda: i64,
    ipiv: *const i64,
    dataTypeB: cudaDataType,
    B: *mut c_void,
    ldb: i64,
    info: *mut c_int,
) -> cusolverStatus_t
Expand description

This function solves a linear system of multiple right-hand sides: $$ op(A)\*X = B $$

where A is an $n \times n$ matrix, and was LU-factored by cusolverDnXgetrf, that is, lower triangular part of A is L, and upper triangular part (including diagonal elements) of A is U. B is an $n \times {nrhs}$ right-hand side matrix using the generic API interface.

The input parameter trans is defined by: $$ \operatorname{op}(A) = \begin{cases} A & \text{if } trans = \text{CUBLAS_OP_N} \ A^T & \text{if } trans = \text{CUBLAS_OP_T} \ A^H & \text{if } trans = \text{CUBLAS_OP_C} \end{cases} $$

The input parameter ipiv is an output of cusolverDnXgetrf. It contains pivot indices, which are used to permutate right-hand sides.

If output parameter info = -i (less than zero), the i-th parameter is wrong (not counting handle).

The user can combine cusolverDnXgetrf and cusolverDnXgetrs to complete a linear solver.

Currently, cusolverDnXgetrs supports only the default algorithm.

Please visit cuSOLVER Library Samples - Xgetrf for a code example.

Algorithms supported by cusolverDnXgetrs

cusolverAlgMode_t::CUSOLVER_ALG_0 or NULLDefault algorithm.

List of input arguments for cusolverDnXgetrs:

The generic API has two different types: dataTypeA is data type of the matrix A and dataTypeB is data type of the matrix B. cusolverDnXgetrs only supports the following four combinations:

Valid combination of data type and compute type

DataTypeAdataTypeBMeaning
CUDA_R_32FCUDA_R_32FSGETRS
CUDA_R_64FCUDA_R_64FDGETRS
CUDA_C_32FCUDA_C_32FCGETRS
CUDA_C_64FCUDA_C_64FZGETRS

§Parameters

  • handle: Handle to the cuSolverDN library context.
  • params: Structure with information collected by cusolverDnSetAdvOptions.
  • trans: Operation op(A) that is non- or (conj.) transpose.
  • n: Number of rows and columns of matrix A.
  • nrhs: Number of right-hand sides.
  • dataTypeA: Data type of array A.
  • A: Array of dimension lda * n with lda is not less than max(1,n).
  • lda: Leading dimension of two-dimensional array used to store matrix A.
  • ipiv: Array of size at least n, containing pivot indices.
  • dataTypeB: Data type of array B.
  • B: <type> array of dimension ldb * nrhs with ldb is not less than max(1,n).
  • ldb: Leading dimension of two-dimensional array used to store matrix B.
  • info: If info = 0, the operation is successful. If info = -i, the i-th parameter is wrong (not counting handle).

§Return value