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_tExpand 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 NULL | Default 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
| DataTypeA | dataTypeB | Meaning |
|---|---|---|
CUDA_R_32F | CUDA_R_32F | SGETRS |
CUDA_R_64F | CUDA_R_64F | DGETRS |
CUDA_C_32F | CUDA_C_32F | CGETRS |
CUDA_C_64F | CUDA_C_64F | ZGETRS |
§Parameters
handle: Handle to the cuSolverDN library context.params: Structure with information collected bycusolverDnSetAdvOptions.trans: Operationop(A)that is non- or (conj.) transpose.n: Number of rows and columns of matrixA.nrhs: Number of right-hand sides.dataTypeA: Data type of arrayA.A: Array of dimensionlda * nwithldais not less thanmax(1,n).lda: Leading dimension of two-dimensional array used to store matrixA.ipiv: Array of size at leastn, containing pivot indices.dataTypeB: Data type of arrayB.B: <type> array of dimensionldb * nrhswithldbis not less thanmax(1,n).ldb: Leading dimension of two-dimensional array used to store matrixB.info: Ifinfo = 0, the operation is successful. Ifinfo = -i, thei-thparameter is wrong (not counting handle).
§Return value
cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR: An internal operation failed.cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE: Invalid parameters were passed (n<0orlda<max(1,n)orldb<max(1,n)).cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED: The library was not initialized.cusolverStatus_t::CUSOLVER_STATUS_SUCCESS: The operation completed successfully.