xref: /petsc/src/mat/impls/aij/mpi/mpicusparse/mpicusparsematimpl.h (revision 3fa6b06a16b9e10b6e41dcaa1d4ab6dd90b29d60)
1519f805aSKarl Rupp #if !defined(__MPICUSPARSEMATIMPL)
2bbf3fe20SPaul Mullowney #define __MPICUSPARSEMATIMPL
3bbf3fe20SPaul Mullowney 
4b06137fdSPaul Mullowney #include <cusparse_v2.h>
5303a667bSSatish Balay #include <petsc/private/cudavecimpl.h>
6b06137fdSPaul Mullowney 
7bbf3fe20SPaul Mullowney typedef struct {
8bbf3fe20SPaul Mullowney   /* The following are used by GPU capabilities to store matrix storage formats on the device */
9e057df02SPaul Mullowney   MatCUSPARSEStorageFormat   diagGPUMatFormat;
10e057df02SPaul Mullowney   MatCUSPARSEStorageFormat   offdiagGPUMatFormat;
11b06137fdSPaul Mullowney   cudaStream_t               stream;
12b06137fdSPaul Mullowney   cusparseHandle_t           handle;
13*3fa6b06aSMark Adams   PetscSplitCSRDataStructure *deviceMat;
14bbf3fe20SPaul Mullowney } Mat_MPIAIJCUSPARSE;
15bbf3fe20SPaul Mullowney 
16b06137fdSPaul Mullowney PETSC_INTERN PetscErrorCode MatCUSPARSESetStream(Mat, const cudaStream_t stream);
17b06137fdSPaul Mullowney PETSC_INTERN PetscErrorCode MatCUSPARSESetHandle(Mat, const cusparseHandle_t handle);
18b06137fdSPaul Mullowney PETSC_INTERN PetscErrorCode MatCUSPARSEClearHandle(Mat);
19b06137fdSPaul Mullowney 
20bbf3fe20SPaul Mullowney #endif
21