Actual source code: vecregall.c

      1: #include <petscvec.h>
      2: #include <petsc/private/vecimpl.h>
      3: PETSC_EXTERN PetscErrorCode VecCreate_Seq(Vec);
      4: PETSC_EXTERN PetscErrorCode VecCreate_MPI(Vec);
      5: PETSC_EXTERN PetscErrorCode VecCreate_Standard(Vec);
      6: PETSC_EXTERN PetscErrorCode VecCreate_Shared(Vec);
      7: #if defined(PETSC_HAVE_MPI_PROCESS_SHARED_MEMORY)
      8: PETSC_EXTERN PetscErrorCode VecCreate_Node(Vec);
      9: #endif
     10: #if defined(PETSC_HAVE_VIENNACL)
     11: PETSC_EXTERN PetscErrorCode VecCreate_SeqViennaCL(Vec);
     12: PETSC_EXTERN PetscErrorCode VecCreate_MPIViennaCL(Vec);
     13: PETSC_EXTERN PetscErrorCode VecCreate_ViennaCL(Vec);
     14: #endif
     15: #if defined(PETSC_HAVE_KOKKOS_KERNELS)
     16: PETSC_EXTERN PetscErrorCode VecCreate_SeqKokkos(Vec);
     17: PETSC_EXTERN PetscErrorCode VecCreate_MPIKokkos(Vec);
     18: PETSC_EXTERN PetscErrorCode VecCreate_Kokkos(Vec);
     19: #endif

     21: PetscBool VecRegisterAllCalled = PETSC_FALSE;

     23: /*@C
     24:   VecRegisterAll - Registers all of the vector types in the `Vec` package.

     26:   Not Collective

     28:   Level: advanced

     30: .seealso: [](ch_vectors), `Vec`, `VecType`, `VecRegister()`, `VecRegisterDestroy()`
     31: @*/
     32: PetscErrorCode VecRegisterAll(void)
     33: {
     34:   PetscFunctionBegin;
     35:   if (VecRegisterAllCalled) PetscFunctionReturn(PETSC_SUCCESS);
     36:   VecRegisterAllCalled = PETSC_TRUE;

     38:   PetscCall(VecRegister(VECSEQ, VecCreate_Seq));
     39:   PetscCall(VecRegister(VECMPI, VecCreate_MPI));
     40:   PetscCall(VecRegister(VECSTANDARD, VecCreate_Standard));
     41:   PetscCall(VecRegister(VECSHARED, VecCreate_Shared));
     42: #if defined PETSC_HAVE_VIENNACL
     43:   PetscCall(VecRegister(VECSEQVIENNACL, VecCreate_SeqViennaCL));
     44:   PetscCall(VecRegister(VECMPIVIENNACL, VecCreate_MPIViennaCL));
     45:   PetscCall(VecRegister(VECVIENNACL, VecCreate_ViennaCL));
     46: #endif
     47: #if defined(PETSC_HAVE_CUDA)
     48:   PetscCall(VecRegister(VECSEQCUDA, VecCreate_SeqCUDA));
     49:   PetscCall(VecRegister(VECMPICUDA, VecCreate_MPICUDA));
     50:   PetscCall(VecRegister(VECCUDA, VecCreate_CUDA));
     51: #endif
     52: #if defined(PETSC_HAVE_KOKKOS_KERNELS)
     53:   PetscCall(VecRegister(VECSEQKOKKOS, VecCreate_SeqKokkos));
     54:   PetscCall(VecRegister(VECMPIKOKKOS, VecCreate_MPIKokkos));
     55:   PetscCall(VecRegister(VECKOKKOS, VecCreate_Kokkos));
     56: #endif
     57: #if defined(PETSC_HAVE_HIP)
     58:   PetscCall(VecRegister(VECSEQHIP, VecCreate_SeqHIP));
     59:   PetscCall(VecRegister(VECMPIHIP, VecCreate_MPIHIP));
     60:   PetscCall(VecRegister(VECHIP, VecCreate_HIP));
     61: #endif
     62:   PetscFunctionReturn(PETSC_SUCCESS);
     63: }