ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
diago_cusolver.h
Go to the documentation of this file.
1#ifndef DIAGOCUSOLVER_H
2#define DIAGOCUSOLVER_H
3
4#include "source_base/macros.h" // GetRealType
7#include "source_hsolver/kernels/cuda/diag_cusolver.cuh"
8// #include "source_hsolver/kernels/cuda/dngvd_op.cu"
9
10namespace hsolver
11{
12
13// DiagoCusolver class for diagonalization using CUSOLVER
14template <typename T>
16{
17 private:
18 // Real is the real part of the complex type T
19 using Real = typename GetTypeReal<T>::type;
21
22 public:
23
24 DiagoCusolver(const Parallel_Orbitals* ParaV = nullptr);
26
27 // Override the diag function for CUSOLVER diagonalization
28 void diag(hamilt::Hamilt<T>* phm_in, psi::Psi<T>& psi, Real* eigenvalue_in);
29
30 // Static variable to keep track of the decomposition state
31 static int DecomposedState;
32
33 // Diag_Cusolver_gvd object for CUSOLVER operations
34 Diag_Cusolver_gvd dc;
35
36 private:
37#ifdef __MPI
38 // Function to check if ELPA handle needs to be created or reused in MPI settings
39 bool ifElpaHandle(const bool& newIteration, const bool& ifNSCF);
40#endif
41};
42
43} // namespace hsolver
44
45#endif
Definition parallel_orbitals.h:9
Definition hamilt.h:16
Definition diago_cusolver.h:16
typename GetTypeReal< T >::type Real
Definition diago_cusolver.h:19
Parallel_Orbitals const * ParaV
Definition diago_cusolver.h:20
bool ifElpaHandle(const bool &newIteration, const bool &ifNSCF)
Diag_Cusolver_gvd dc
Definition diago_cusolver.h:34
~DiagoCusolver()
Definition diago_cusolver.cpp:39
static int DecomposedState
Definition diago_cusolver.h:31
void diag(hamilt::Hamilt< T > *phm_in, psi::Psi< T > &psi, Real *eigenvalue_in)
Definition diago_cusolver.cpp:116
Definition psi.h:37
Definition diag_comm_info.h:9
Definition exx_lip.h:23
T type
Definition macros.h:8