xref: /petsc/src/mat/impls/aij/mpi/mpicusparse/mpicusparsematimpl.h (revision 042217e806e4e3ebc5975c28dbf27a273923695f)
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*042217e8SBarry Smith   PetscSplitCSRDataStructure deviceMat;
147e8381f9SStefano Zampini   PetscInt                   coo_nd,coo_no;
157e8381f9SStefano Zampini   THRUSTINTARRAY             *coo_p;
167e8381f9SStefano Zampini   THRUSTARRAY                *coo_pw;
17bbf3fe20SPaul Mullowney } Mat_MPIAIJCUSPARSE;
18bbf3fe20SPaul Mullowney 
19b06137fdSPaul Mullowney PETSC_INTERN PetscErrorCode MatCUSPARSESetStream(Mat, const cudaStream_t stream);
20b06137fdSPaul Mullowney PETSC_INTERN PetscErrorCode MatCUSPARSESetHandle(Mat, const cusparseHandle_t handle);
21b06137fdSPaul Mullowney PETSC_INTERN PetscErrorCode MatCUSPARSEClearHandle(Mat);
22b06137fdSPaul Mullowney 
23bbf3fe20SPaul Mullowney #endif
24