Actual source code: viennaclmatimpl.h


  4: #define PETSC_SKIP_IMMINTRIN_H_CUDAWORKAROUND 1
  5: #include <../src/mat/impls/aij/seq/aij.h>

  7: /* Pulls in some ViennaCL includes as well as VIENNACL_WITH_OPENCL: */
  8: #include <../src/vec/vec/impls/seq/seqviennacl/viennaclvecimpl.h>

 10: /* for everything else */
 11: #include "viennacl/compressed_matrix.hpp"
 12: #include "viennacl/compressed_compressed_matrix.hpp"

 14: typedef viennacl::compressed_matrix<PetscScalar>   ViennaCLAIJMatrix;
 15: typedef viennacl::compressed_compressed_matrix<PetscScalar>   ViennaCLCompressedAIJMatrix;

 17: struct Mat_SeqAIJViennaCL {
 18:   Mat_SeqAIJViennaCL() : tempvec(NULL), mat(NULL), compressed_mat(NULL) {}
 19:   ViennaCLVector               *tempvec;
 20:   ViennaCLAIJMatrix            *mat;  /* pointer to the matrix on the GPU */
 21:   ViennaCLCompressedAIJMatrix  *compressed_mat; /* compressed CSR */
 22: };

 24: PETSC_INTERN PetscErrorCode MatViennaCLCopyToGPU(Mat);
 25: PETSC_INTERN PetscErrorCode MatViennaCLCopyFromGPU(Mat, ViennaCLAIJMatrix*);
 26: #endif