Actual source code: petscviennacl.h

petsc-3.14.6 2021-03-30
Report Typos and Errors
  1: #if !defined(PETSCVIENNACL_H)
  2: #define PETSCVIENNACL_H

  4: #include <petscvec.h>

  6: #if defined(PETSC_HAVE_CUDA)
  7: #define VIENNACL_WITH_CUDA
  8: #endif

 10: #if defined(PETSC_HAVE_OPENCL)
 11: #define VIENNACL_WITH_OPENCL
 12: #endif

 14: #if defined(PETSC_HAVE_OPENMP)
 15: #define VIENNACL_WITH_OPENMP
 16: #endif

 18: #include <viennacl/forwards.h>
 19: #include <viennacl/vector_proxy.hpp>
 20: #include <viennacl/vector.hpp>

 22: PETSC_EXTERN PetscErrorCode VecViennaCLGetArray(Vec v, viennacl::vector<PetscScalar> **a);
 23: PETSC_EXTERN PetscErrorCode VecViennaCLRestoreArray(Vec v, viennacl::vector<PetscScalar> **a);

 25: PETSC_EXTERN PetscErrorCode VecViennaCLGetArrayRead(Vec v, const viennacl::vector<PetscScalar> **a);
 26: PETSC_EXTERN PetscErrorCode VecViennaCLRestoreArrayRead(Vec v, const viennacl::vector<PetscScalar> **a);

 28: PETSC_EXTERN PetscErrorCode VecViennaCLGetArrayWrite(Vec v, viennacl::vector<PetscScalar> **a);
 29: PETSC_EXTERN PetscErrorCode VecViennaCLRestoreArrayWrite(Vec v, viennacl::vector<PetscScalar> **a);

 31: PETSC_EXTERN PetscErrorCode VecCreateSeqViennaCLWithArray(MPI_Comm,PetscInt,PetscInt,const viennacl::vector<PetscScalar> *,Vec *);
 32: PETSC_EXTERN PetscErrorCode VecCreateSeqViennaCLWithArrays(MPI_Comm,PetscInt,PetscInt,const PetscScalar*,const viennacl::vector<PetscScalar> *,Vec *);
 33: PETSC_EXTERN PetscErrorCode VecCreateMPIViennaCLWithArray(MPI_Comm,PetscInt,PetscInt,PetscInt,const viennacl::vector<PetscScalar> *,Vec *);
 34: PETSC_EXTERN PetscErrorCode VecCreateMPIViennaCLWithArrays(MPI_Comm,PetscInt,PetscInt,PetscInt,const PetscScalar *,const viennacl::vector<PetscScalar> *,Vec *);

 36: PETSC_EXTERN PetscErrorCode VecViennaCLPlaceArray(Vec,const viennacl::vector<PetscScalar> *);
 37: PETSC_EXTERN PetscErrorCode VecViennaCLResetArray(Vec);


 40: #endif