1519f805aSKarl Rupp #if !defined(__MPICUSPARSEMATIMPL) 2bbf3fe20SPaul Mullowney #define __MPICUSPARSEMATIMPL 3bbf3fe20SPaul Mullowney 4b06137fdSPaul Mullowney #include <cusparse_v2.h> 5*303a667bSSatish 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; 13bbf3fe20SPaul Mullowney } Mat_MPIAIJCUSPARSE; 14bbf3fe20SPaul Mullowney 15b06137fdSPaul Mullowney PETSC_INTERN PetscErrorCode MatCUSPARSESetStream(Mat, const cudaStream_t stream); 16b06137fdSPaul Mullowney PETSC_INTERN PetscErrorCode MatCUSPARSESetHandle(Mat, const cusparseHandle_t handle); 17b06137fdSPaul Mullowney PETSC_INTERN PetscErrorCode MatCUSPARSEClearHandle(Mat); 18b06137fdSPaul Mullowney 19bbf3fe20SPaul Mullowney #endif 20