1 #pragma once 2 3 #include <petsc/private/pcimpl.h> 4 5 /* 6 Private context (data structure) for the PBJacobi preconditioner. 7 */ 8 typedef struct { 9 const MatScalar *diag; 10 PetscInt bs, mbs; /* block size (bs), and number of blocks (mbs) */ 11 Mat diagPB; /* the matrix made of the diagonal blocks if some shell smatrix provided it; otherwise, NULL. Need to destroy it after use */ 12 void *spptr; /* opaque pointer to a device data structure */ 13 } PC_PBJacobi; 14 15 #if defined(PETSC_HAVE_CUDA) 16 PETSC_INTERN PetscErrorCode PCSetUp_PBJacobi_CUDA(PC, Mat); 17 #endif 18 19 #if defined(PETSC_HAVE_KOKKOS_KERNELS) 20 PETSC_INTERN PetscErrorCode PCSetUp_PBJacobi_Kokkos(PC, Mat); 21 #endif 22 23 PETSC_INTERN PetscErrorCode PCSetUp_PBJacobi_Host(PC, Mat); 24 PETSC_INTERN PetscErrorCode PCDestroy_PBJacobi(PC); 25