Actual source code: viennaclmatimpl.h

petsc-3.12.2 2019-11-22
Report Typos and Errors

  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"


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


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

 26: PETSC_INTERN PetscErrorCode MatViennaCLCopyToGPU(Mat);
 27: PETSC_INTERN PetscErrorCode MatViennaCLCopyFromGPU(Mat, ViennaCLAIJMatrix*);
 28: #endif