MATSEQAIJCUSPARSE — PETSc 3.25.2 documentation

Skip to main content
`Ctrl`+`K`

# MATSEQAIJCUSPARSE

MATAIJCUSPARSE = “(seq)aijcusparse” - A matrix type to be used for sparse matrices on NVIDIA GPUs.

## Options Database Keys

- -mat_type aijcusparse - Sets the matrix type to “seqaijcusparse” during a call to `MatSetFromOptions()`

- -mat_cusparse_storage_format csr - Sets the storage format of matrices (for `MatMult()` and factors in `MatSolve()`). Other options include ell (ellpack) or hyb (hybrid).

- -mat_cusparse_mult_storage_format csr - Sets the storage format of matrices (for `MatMult()`). Other options include ell (ellpack) or hyb (hybrid).

- -mat_cusparse_use_cpu_solve - Performs the `MatSolve()` on the CPU

## Notes

These matrices can be in either CSR, ELL, or HYB format.

All matrix calculations are performed on NVIDIA GPUs using the cuSPARSE library.

Uses 32-bit integers internally. If PETSc is configured `--with-64-bit-indices`, the integer row and column indices are stored on the GPU with `int`. It is unclear what happens if some integer values passed in do not fit in `int`.

## See Also

Matrices, `Mat`, `MatCreateSeqAIJCUSPARSE()`, `MatCUSPARSESetUseCPUSolve()`, `MATAIJCUSPARSE`, `MatCreateAIJCUSPARSE()`, `MatCUSPARSESetFormat()`, `MatCUSPARSEStorageFormat`, `MatCUSPARSEFormatOperation`

## Level

beginner

## Location

src/mat/impls/aij/seq/seqcusparse/aijcusparse.cu

## Examples

src/mat/tutorials/ex18.c
src/ksp/ksp/tutorials/ex79.c

Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages