MatCUSPARSESetUseCPUSolve — PETSc 3.21.4 documentation

Skip to main content
`Ctrl`+`K`

# MatCUSPARSESetUseCPUSolve

Sets to use CPU `MatSolve()`.

## Synopsis

    #include "petscmat.h"
    PetscErrorCode MatCUSPARSESetUseCPUSolve(Mat A, PetscBool use_cpu)

## Input Parameters

- A - Matrix of type `MATSEQAIJCUSPARSE`

- use_cpu - set flag for using the built-in CPU `MatSolve()`

## Note

The cuSparse LU solver currently computes the factors with the built-in CPU method and moves the factors to the GPU for the solve. We have observed better performance keeping the data on the CPU and computing the solve there. This method to specify if the solve is done on the CPU or GPU (GPU is the default).

## See Also

Matrices, `Mat`, `MatSolve()`, `MATSEQAIJCUSPARSE`, `MatCUSPARSEStorageFormat`, `MatCUSPARSEFormatOperation`

## Level

intermediate

## Location

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

## Implementations

MatCUSPARSESetUseCPUSolve_SeqAIJCUSPARSE() in src/mat/impls/aij/seq/seqcusparse/aijcusparse.cu

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