Examples Using Cholesky and LU Linear Solve Functions#

  • potrf.cu

  • potrf_runtime_ld.cu

  • posv_batched.cu

The simple_potrf example computes Cholesky factorization for a Hermitian positive-definite matrix using cuSolverDx, and compares the Cholesky factors with the ones generated using cuSolver host API cusolverDnXportf.

In some workflow the matrix A could have already resided in the shared memory, padded to avoid bank conflict, and updated by other operations. The potrf_runtime_ld example shows how to compute Cholesky factorization using runtime leading dimensions, which overwrite values defined by LeadingDimension Operator. The results are compared with these computed using cuSolver host API cusolverDnXportf.

The posv_batched example is described in the Introduction Example.

  • getrf_wo_pivot.cu

  • getrf_partial_pivot.cu

  • gesv_batched_wo_pivot.cu

  • gesv_batched_partial_pivot.cu

  • gtsv_batched_no_pivot.cu

The getrf_wo_pivot example demonstrates how to use cuSolverDx API to perform LU factorization without pivoting on a diagonal dominant M x N matrix. The results are compared with the reference values obtained with cuSolver host API cusovlerDnXgetrf.

The getrf_partial_pivot example demonstrates how to use cuSolverDx API to perform LU factorization with partial pivoting on a general M x N matrix. The resulted factors as well as the pivot indices, ipiv, are compared with the reference values obtained with cuSolver host API cusovlerDnXgetrf.

The gesv_batched_wo_pivot example solves a batched linear systems with multiple right hand sides after performing LU factorization (without pivoting) of a batched general matrix. The results are compared with the reference values obtained with cuSolver host API, cusovlerDnXgetrf followed by cusovlerDnXgetrs.

The gesv_batched_partial_pivot example solves a batched linear systems with multiple right hand sides after performing LU factorization (with partial pivoting) of a batched general matrix. The results are compared with the reference values obtained with cuSolver host API, cusovlerDnXgetrf followed by cusovlerDnXgetrs.

The gtsv_batched_no_pivot example solves a batched tridiagonal systems with multiple right hand sides. The results are compared with the reference values obtained with cuSparse host API, cusparse<t>gtsv2StridedBatch.