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
6#include "source_hsolver/kernels/cuda/diag_cusolver.cuh"
7#include "source_psi/psi.h"
8
9namespace hsolver
10{
11
12// DiagoCusolver class for diagonalization using CUSOLVER
13template <typename T>
15{
16 private:
17 // Real is the real part of the complex type T
18 using Real = typename GetTypeReal<T>::type;
19
20 public:
21
24 DiagoCusolver(const int nlocal_in, const int nbands_in);
26
27 // Override the diag function for CUSOLVER diagonalization
28 void diag(
32 Real* eigenvalue_in);
33
34 // Static variable to keep track of the decomposition state
35 static int DecomposedState;
36
37 // Diag_Cusolver_gvd object for CUSOLVER operations
38 Diag_Cusolver_gvd dc;
39
40 private:
41#ifdef __MPI
42 // Function to check if ELPA handle needs to be created or reused in MPI settings
43 bool ifElpaHandle(const bool& newIteration, const bool& ifNSCF) const;
44#endif
45
46 const int nlocal;
47 const int nbands;
48};
49
50} // namespace hsolver
51
52#endif
typename GetTypeReal< T >::type Real
Definition diago_cusolver.h:18
void diag(ModuleBase::MatrixBlock< T > &h_mat, ModuleBase::MatrixBlock< T > &s_mat, psi::Psi< T > &psi, Real *eigenvalue_in)
Definition diago_cusolver.cpp:66
const int nlocal
Definition diago_cusolver.h:46
Diag_Cusolver_gvd dc
Definition diago_cusolver.h:38
~DiagoCusolver()
Definition diago_cusolver.cpp:25
static int DecomposedState
Definition diago_cusolver.h:35
DiagoCusolver(const int nlocal_in, const int nbands_in)
Definition diago_cusolver.cpp:20
bool ifElpaHandle(const bool &newIteration, const bool &ifNSCF) const
const int nbands
Definition diago_cusolver.h:47
Definition psi.h:37
Definition dense_eigensolver.cpp:23
Definition diag_lcao.h:14
T type
Definition macros.h:8
A non-owning description of a matrix stored in memory.
Definition matrix_block.h:23