# MatHIPSPARSESetUseCPUSolve
Sets use CPU `MatSolve()`. 
## Synopsis
```
#include "petscmat.h" 
PetscErrorCode MatHIPSPARSESetUseCPUSolve(Mat A, PetscBool use_cpu)
```

## Input Parameters

- ***A -*** Matrix of type `MATSEQAIJHIPSPARSE`
- ***use_cpu -*** set flag for using the built-in CPU `MatSolve()`



## Output Parameter


## Notes
The hipSparse 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
 `MatSolve()`, `MATSEQAIJHIPSPARSE`, `MatHIPSPARSEStorageFormat`, `MatHIPSPARSEFormatOperation`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/aij/seq/seqhipsparse/aijhipsparse.hip.cpp#MatHIPSPARSESetUseCPUSolve">src/mat/impls/aij/seq/seqhipsparse/aijhipsparse.hip.cpp</A>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/aij/seq/seqhipsparse/aijhipsparse.hip.c.html#MatHIPSPARSESetUseCPUSolve_SeqAIJHIPSPARSE">MatHIPSPARSESetUseCPUSolve_SeqAIJHIPSPARSE in src/mat/impls/aij/seq/seqhipsparse/aijhipsparse.hip.c</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/mat/impls/aij/seq/seqhipsparse/aijhipsparse.hip.cpp)


[Index of all Mat routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
