Solve Linear Systems After LU Factorization#
GETRS (GEneral TRiangular Solve) function solves a system of linear equations
where
Ais the input batched LU-factorizedN x Nmatrix. The lower triangular part ofAisL, and upper triangular part (including diagonal elements) ofAisU.Bis the input batchedN x Kright hand side matrix.Xis the output batchedN x Kright hand side matrix.Operation
op(A)indicates if matrixAisnon_transposed,transposedfor real data type, orconj_transposedfor complex data type.
cuSolverDx provides separate function operators depending on whether pivoting is to be performed:
cusolverdx::function::getrs_no_pivot: Linear system solve using LU factors with no pivoting.cusolverdx::function::getrs_partial_pivot: Linear system solve using LU factors with partial pivoting.
cuSolverDx getrs_no_pivot device functions are (see Execution Methods):
__device__ void execute(const data_type* A, data_type* B);
// with runtime leading dimensions
__device__ void execute(const data_type* A, const unsigned int lda,
data_type* B);
__device__ void execute(const data_type* A,
data_type* B, const unsigned int ldb);
__device__ void execute(const data_type* A, const unsigned int lda,
data_type* B, const unsigned int ldb);
cuSolverDx getrs_partial_pivot device functions are:
__device__ void execute(const data_type* A, const int* ipiv, data_type* B);
// with runtime leading dimensions
__device__ void execute(const data_type* A, const unsigned int lda,
const int* ipiv,
data_type* B);
__device__ void execute(const data_type* A,
const int* ipiv,
data_type* B, const unsigned int ldb);
__device__ void execute(const data_type* A, const unsigned int lda,
const int* ipiv,
data_type* B, const unsigned int ldb);
A is a batched N x N LU-factorized general matrix. The lower triangular part of A is L, and upper triangular part (including diagonal elements) of A is U. The leading dimension of A is lda >= N regardless matrix A is in column- or row-major layout.
For getrs_partial_pivot, the input ipiv is an array of size N for each batch, and ipiv[batch_id, i] indicates the row i interchanges with row ipiv[batch_id, i] on the batch_id-th batch of A.
B is a batched N x K righ-hand side matrix. The operation is in-place, i.e. matrix X overwrites matrix B with the same leading dimension ldb. The leading dimension of B is ldb >= K if B is column-major, or ldb >= N if B is row-major.
The functions support:
AandBeither being the same or different column- or row-major layouts, see Arrangement operator, and\(op(A)\) either being
non_transposed,transposedfor real data type, orconj_transposedfor complex data type, see TransposeMode operator.