3.1.2.3. 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¶
This function is for some pre-application steps for the distributed HEMM in ChASE. These steps may vary in different implementations targetting different architectures. These steps can be backup of some buffers, copy data from CPU to GPU, etc.
- Parameters:
V1 – a pointer to a matrix
locked – an integer indicating the number of locked (converged) eigenvectors
block – an integer indicating the number of non-locked (non-converged) eigenvectors
-
inline virtual void apply(T alpha, T beta, std::size_t offset, std::size_t block, std::size_t locked) override¶
Performs \(V_2<- \alpha V1H + \beta V_2\) and
swap\((V_1,V_2)\).The first
offsetvectors of V1 and V2 are not part of theHEMM. The number of vectors performed inV1andV2isblockInMATLABnotation, this operation performs:V2[:,start:end]<-alpha*V1[:,start:end]*H+beta*V2[:,start:end],in which
start=locked+offsetandend=locked+offset+block.- Parameters:
alpha – a scalar times on
V1*HinHEMMoperation.beta – a scalar times on
V2inHEMMoperation.offset – an offset of number vectors which the
HEMMstarting from.block – number of non-converged eigenvectors, it indicates the number of vectors in
V1andV2to performHEMM.locked – number of converged eigenvectors.
-
inline virtual void shiftMatrix(T c, bool isunshift = false) override¶
This function shifts the diagonal of global matrix with a constant value
c.- Parameters:
c – shift value
-
inline virtual void applyVec(T *B, T *C, std::size_t n) override¶
Performs a Generalized Matrix Vector Multiplication (
GEMV) withalpha=1.0andbeta=0.0.The operation is
C=H*B.- Parameters:
B – the vector to be multiplied on
H.C – the vector to store the product of
HandB.
-
inline virtual void axpy(std::size_t N, T *alpha, T *x, std::size_t incx, T *y, std::size_t incy) override¶
A
BLAS-likefunction which performs a constant times a vector plus a vector.- Parameters:
N – [in] number of elements in input vector(s).
alpha – [in] a scalar times on
xinAXPYoperation.x – [in] an array of type
T, dimension( 1 + ( N - 1 )*abs( incx ).incx – [in] storage spacing between elements of
x.[in/out] – y: an array of type
T, dimension( 1 + ( N - 1 )*abs( incy ).incy – [in] storage spacing between elements of
y.
-
inline virtual void scal(std::size_t N, T *a, T *x, std::size_t incx) override¶
A
BLAS-likefunction which scales a vector by a constant.- Parameters:
N – [in] number of elements in input vector(s).
a – [in] a scalar of type
Ttimes on vectorx.[in/out] – x: an array of type
T, dimension( 1 + ( N - 1 )*abs( incx ).incx – [in] storage spacing between elements of
x.
-
inline virtual Base<T> nrm2(std::size_t n, T *x, std::size_t incx) override¶
A
BLAS-likefunction which returns the euclidean norm of a vector.- Parameters:
N – [in] number of elements in input vector(s).
x – [in] an array of type
T, dimension( 1 + ( N - 1 )*abs( incx ).incx – [in] storage spacing between elements of
x.
- Returns:
the euclidean norm of vector
x.
-
inline virtual T dot(std::size_t n, T *x, std::size_t incx, T *y, std::size_t incy) override¶
A
BLAS-likefunction which forms the dot product of two vectors.- Parameters:
N – [in] number of elements in input vector(s).
x – [in] an array of type
T, dimension( 1 + ( N - 1 )*abs( incx ).incx – [in] storage spacing between elements of
x.y – [in] an array of type
T, dimension( 1 + ( N - 1 )*abs( incy ).incy – [in] storage spacing between elements of
y.
- Returns:
the dot product of vectors
xandy.
-
inline virtual void preApplication(T *V, std::size_t locked, std::size_t block) override¶