Single GPU

template<class T>
class ChaseMpiDLACudaSeq : public chase::mpi::ChaseMpiDLAInterface<T>

A derived class of ChaseMpiDLAInterface which implements ChASE targeting shared-memory architectures, some selected computation tasks are offloaded to one single GPU card.

Public Functions

inline virtual void preApplication(T *V, std::size_t locked, std::size_t block) override

  • For ChaseMpiDLACudaSeq, the core of preApplication is implemented with cudaMemcpyAsync, which copies block vectors from V on Host to V1` on GPU device.

  • Parallelism is NOT SUPPORT

  • For the meaning of this function, please visit ChaseMpiDLAInterface.

inline virtual void preApplication(T *V1, T *V2, std::size_t locked, std::size_t block) override

  • For ChaseMpiDLACudaSeq, the core of preApplication is implemented with cudaMemcpyAsync, which copies block vectors from V2 on Host to V2_` on GPU device.

  • Parallelism is NOT SUPPORT

  • For the meaning of this function, please visit ChaseMpiDLAInterface.

inline virtual void apply(T alpha, T beta, std::size_t offset, std::size_t block) override

  • For ChaseMpiDLACudaSeq, apply is implemented with cublasXgemm provided by cuBLAS.

  • Parallelism is SUPPORT within one GPU card

  • For the meaning of this function, please visit ChaseMpiDLAInterface.

inline virtual bool postApplication(T *V, std::size_t block) override

  • For ChaseMpiDLACudaSeq, the core of postApplication is implemented with cudaMemcpyAsync, which copies block vectors from V1_ on GPU device to V` on Host.

  • Parallelism is NOT SUPPORT

  • For the meaning of this function, please visit ChaseMpiDLAInterface.

inline virtual void shiftMatrix(T c, bool isunshift = false) override

  • For ChaseMpiDLACudaSeq, shiftMatrix is offloaded to GPU device and implemented by CUDA.

  • Parallelism is SUPPORT within one GPU card

  • For the meaning of this function, please visit ChaseMpiDLAInterface.

inline virtual void applyVec(T *B, T *C) override

  • For ChaseMpiDLACudaSeq, applyVec is implemented with GEMM provided by BLAS.

  • Parallelism is SUPPORT within node if multi-threading is actived

  • For the meaning of this function, please visit ChaseMpiDLAInterface.

inline virtual Base<T> lange(char norm, std::size_t m, std::size_t n, T *A, std::size_t lda) override

  • For ChaseMpiDLACudaSeq, lange is implemented using LAPACK routine xLANGE.

  • Parallelism is SUPPORT within node if multi-threading is actived

  • For the meaning of this function, please visit ChaseMpiDLAInterface.

inline virtual void axpy(std::size_t N, T *alpha, T *x, std::size_t incx, T *y, std::size_t incy) override

  • For ChaseMpiDLACudaSeq, axpy is implemented using BLAS routine xAXPY.

  • Parallelism is SUPPORT within node if multi-threading is actived

  • For the meaning of this function, please visit ChaseMpiDLAInterface.

inline virtual void scal(std::size_t N, T *a, T *x, std::size_t incx) override

  • For ChaseMpiDLACudaSeq, scal is implemented using BLAS routine xSCAL.

  • Parallelism is SUPPORT within node if multi-threading is actived

  • For the meaning of this function, please visit ChaseMpiDLAInterface.

inline virtual Base<T> nrm2(std::size_t n, T *x, std::size_t incx) override

  • For ChaseMpiDLACudaSeq, nrm2 is implemented using BLAS routine xNRM2.

  • Parallelism is SUPPORT within node if multi-threading is actived

  • For the meaning of this function, please visit ChaseMpiDLAInterface.

inline virtual T dot(std::size_t n, T *x, std::size_t incx, T *y, std::size_t incy) override

  • For ChaseMpiDLACudaSeq, dot is implemented using BLAS routine xDOT.

  • Parallelism is SUPPORT within node if multi-threading is actived

  • For the meaning of this function, please visit ChaseMpiDLAInterface.

inline virtual void gemm_small(CBLAS_LAYOUT Layout, CBLAS_TRANSPOSE transa, CBLAS_TRANSPOSE transb, std::size_t m, std::size_t n, std::size_t k, T *alpha, T *a, std::size_t lda, T *b, std::size_t ldb, T *beta, T *c, std::size_t ldc) override

  • For ChaseMpiDLACudaSeq, gemm_small is implemented using BLAS routine xGEMM.

  • Parallelism is SUPPORT within node if multi-threading is actived

  • For the meaning of this function, please visit ChaseMpiDLAInterface.

inline virtual void gemm_large(CBLAS_LAYOUT Layout, CBLAS_TRANSPOSE transa, CBLAS_TRANSPOSE transb, std::size_t m, std::size_t n, std::size_t k, T *alpha, T *a, std::size_t lda, T *b, std::size_t ldb, T *beta, T *c, std::size_t ldc) override

  • For ChaseMpiDLACudaSeq, gemm_small is implemented using BLAS routine xGEMM.

  • Parallelism is SUPPORT within node if multi-threading is actived

  • For the meaning of this function, please visit ChaseMpiDLAInterface.

inline virtual std::size_t stemr(int matrix_layout, char jobz, char range, std::size_t n, double *d, double *e, double vl, double vu, std::size_t il, std::size_t iu, int *m, double *w, double *z, std::size_t ldz, std::size_t nzc, int *isuppz, lapack_logical *tryrac) override

  • For ChaseMpiDLACudaSeq, stemr with scalar being real and double precision, is implemented using LAPACK routine DSTEMR.

    • Parallelism is SUPPORT within node if multi-threading is actived

  • For the meaning of this function, please visit ChaseMpiDLAInterface.

inline virtual std::size_t stemr(int matrix_layout, char jobz, char range, std::size_t n, float *d, float *e, float vl, float vu, std::size_t il, std::size_t iu, int *m, float *w, float *z, std::size_t ldz, std::size_t nzc, int *isuppz, lapack_logical *tryrac) override

  • For ChaseMpiDLACudaSeq, stemr with scalar being real and single precision, is implemented using LAPACK routine SSTEMR.

    • Parallelism is SUPPORT within node if multi-threading is actived

  • For the meaning of this function, please visit ChaseMpiDLAInterface.

inline virtual void gegqr(std::size_t N, std::size_t nevex, T *approxV, std::size_t LDA) override

  • For ChaseMpiDLACudaSeq, gegqr is implemented using cuSOLVER routines cusolverDnXgeqrf and cusolverDnXumgqr.

  • Parallelism is SUPPORT within one GPU card

  • For the meaning of this function, please visit ChaseMpiDLAInterface.

inline virtual void RR_kernel(std::size_t N, std::size_t block, T *approxV, std::size_t locked, T *workspace, T One, T Zero, Base<T> *ritzv) override

  • For ChaseMpiDLACudaSeq, RR_kernel is implemented by cublasXgemm routine provided by cuBLAS and (SY)HEEVD routine provided by LAPACK.

    • The 1st operation A <- W^T * V is implemented by cublasXgemm from cuBLAS.

    • The 2nd operation which computes the eigenpairs of A, is implemented by (SY)HEEVD from LAPACK.

    • The 3rd operation which computes W<-V*A is implemented by cublasXgemm from cuBLAS.

  • for (SY)HHEVD, parallelism is SUPPORT within node if multi-threading is actived

  • for cublasXgemm, parallelism is SUPPORT within one GPU card

  • For the meaning of this function, please visit ChaseMpiDLAInterface.