Actual source code: mpicusparsematimpl.h


  4: #include <cusparse_v2.h>
  5: #include <petsc/private/cudavecimpl.h>

  7: typedef struct {
  8:   /* The following are used by GPU capabilities to store matrix storage formats on the device */
  9:   MatCUSPARSEStorageFormat   diagGPUMatFormat;
 10:   MatCUSPARSEStorageFormat   offdiagGPUMatFormat;
 11:   cudaStream_t               stream;
 12:   cusparseHandle_t           handle;
 13:   PetscSplitCSRDataStructure deviceMat;
 14:   PetscInt                   coo_nd,coo_no; /* number of nonzero entries in coo for the diag/offdiag part */
 15:   THRUSTINTARRAY             *coo_p; /* the permutation array that partitions the coo array into diag/offdiag parts */
 16:   THRUSTARRAY                *coo_pw; /* the work array that stores the partitioned coo scalar values */
 17: } Mat_MPIAIJCUSPARSE;

 19: PETSC_INTERN PetscErrorCode MatCUSPARSESetStream(Mat, const cudaStream_t stream);
 20: PETSC_INTERN PetscErrorCode MatCUSPARSESetHandle(Mat, const cusparseHandle_t handle);
 21: PETSC_INTERN PetscErrorCode MatCUSPARSEClearHandle(Mat);

 23: #endif