1687625d7SJacob Faibussowitsch #ifndef PETSC_MPICUSPARSEMATIMPL_H 2687625d7SJacob Faibussowitsch #define PETSC_MPICUSPARSEMATIMPL_H 3bbf3fe20SPaul Mullowney 4b06137fdSPaul Mullowney #include <cusparse_v2.h> 5*6d54fb17SJacob Faibussowitsch #include <petsc/private/veccupmimpl.h> 6b06137fdSPaul Mullowney 7219fbbafSJunchao Zhang struct Mat_MPIAIJCUSPARSE { 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; 11042217e8SBarry Smith PetscSplitCSRDataStructure deviceMat; 12ddea5d60SJunchao Zhang PetscInt coo_nd, coo_no; /* number of nonzero entries in coo for the diag/offdiag part */ 13ddea5d60SJunchao Zhang THRUSTINTARRAY *coo_p; /* the permutation array that partitions the coo array into diag/offdiag parts */ 14ddea5d60SJunchao Zhang THRUSTARRAY *coo_pw; /* the work array that stores the partitioned coo scalar values */ 15219fbbafSJunchao Zhang 16219fbbafSJunchao Zhang /* Extended COO stuff */ 17158ec288SJunchao Zhang PetscCount *Ajmap1_d, *Aperm1_d; /* Local entries to diag */ 18158ec288SJunchao Zhang PetscCount *Bjmap1_d, *Bperm1_d; /* Local entries to offdiag */ 19219fbbafSJunchao Zhang PetscCount *Aimap2_d, *Ajmap2_d, *Aperm2_d; /* Remote entries to diag */ 20219fbbafSJunchao Zhang PetscCount *Bimap2_d, *Bjmap2_d, *Bperm2_d; /* Remote entries to offdiag */ 21219fbbafSJunchao Zhang PetscCount *Cperm1_d; /* Permutation to fill send buffer. 'C' for communication */ 22219fbbafSJunchao Zhang PetscScalar *sendbuf_d, *recvbuf_d; /* Buffers for remote values in MatSetValuesCOO() */ 23219fbbafSJunchao Zhang PetscBool use_extended_coo; 24219fbbafSJunchao Zhang 25d71ae5a4SJacob Faibussowitsch Mat_MPIAIJCUSPARSE() 26d71ae5a4SJacob Faibussowitsch { 27219fbbafSJunchao Zhang diagGPUMatFormat = MAT_CUSPARSE_CSR; 28219fbbafSJunchao Zhang offdiagGPUMatFormat = MAT_CUSPARSE_CSR; 29219fbbafSJunchao Zhang coo_p = NULL; 30219fbbafSJunchao Zhang coo_pw = NULL; 31219fbbafSJunchao Zhang deviceMat = NULL; 32219fbbafSJunchao Zhang use_extended_coo = PETSC_FALSE; 33219fbbafSJunchao Zhang } 34219fbbafSJunchao Zhang }; 35687625d7SJacob Faibussowitsch #endif // PETSC_MPICUSPARSEMATIMPL_H 36