ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
hegvd_op.h
Go to the documentation of this file.
1
4
5// named HEGVD, actually includes HE/SY GV/GVD/GVX
6
7#ifndef MODULE_HSOLVER_HEGVD_H
8#define MODULE_HSOLVER_HEGVD_H
9
10// Note:
11// names follow the same style as standard LAPACK APIs:
12// -----------------------------------
13// he stands for Hermitian
14// sy stands for Symmetric
15// gv stands for Generalized eigenValue problem
16// ev stands for EigenValues
17// dn stands for dense, maybe, who knows?
18// x stands for compute a subset of the eigenvalues and, optionally,
19// their corresponding eigenvectors
20// d for all, x for selected
21// gv: all, gvd: all/devide-and-conquer, x: selected eigenvalues
22// -----------------------------------
23// search for docs using the op function name as keywords.
24
25// TODO: This is a temperary location for these functions.
26// And will be moved to a global module(module base) later.
27
28#include "source_base/macros.h"
31
32namespace hsolver
33{
34
35inline double get_real(const std::complex<double> &x) { return x.real(); }
36
37inline float get_real(const std::complex<float> &x) { return x.real(); }
38
39inline double get_real(const double &x) { return x; }
40
41inline float get_real(const float &x) { return x; }
42
43
44template <typename T, typename Device>
46{
47 using Real = typename GetTypeReal<T>::type;
67 void operator()(const Device* d, const int nstart, const int ldh, const T* A, T* B, Real* W, T* V);
68};
69
70// template <typename T, typename Device>
71// struct hegv_op
72// {
73// using Real = typename GetTypeReal<T>::type;
74// /// @brief HEGV computes first m eigenvalues and eigenvectors of a complex generalized
75// /// Input Parameters
76// /// @param d : the type of device
77// /// @param nbase : the number of dim of the matrix
78// /// @param ldh : the number of dmx of the matrix
79// /// @param A : the hermitian matrix A in A x=lambda B x (col major)
80// /// @param B : the overlap matrix B in A x=lambda B x (col major)
81// /// Output Parameter
82// /// @param W : calculated eigenvalues
83// /// @param V : calculated eigenvectors (col major)
84// void operator()(const Device* d, const int nstart, const int ldh, const T* A, T* B, Real* W, T* V);
85// };
86
87template <typename T, typename Device>
89{
90 using Real = typename GetTypeReal<T>::type;
102 void operator()(const Device* d, const int nstart, const int ldh, T* A, T* B, const int m, Real* W, T* V);
103};
104
105template <typename T, typename Device>
107{
108 using Real = typename GetTypeReal<T>::type;
128 void operator()(const Device *d, const int ndim, const int lda, const T *A, const int neig, Real *w, T *z);
129};
130
131#if __CUDA || __UT_USE_CUDA || __ROCM || __UT_USE_ROCM
132
133void createGpuSolverHandle();
134void destroyGpuSolverHandle();
135
136#endif
137
138} // namespace hsolver
139
140#endif // !MODULE_HSOLVER_HEGVD_H
#define T
Definition exp.cpp:237
Definition diag_comm_info.h:9
double get_real(const std::complex< double > &x)
Definition hegvd_op.h:35
T type
Definition macros.h:8
Definition hegvd_op.h:107
typename GetTypeReal< T >::type Real
Definition hegvd_op.h:108
void operator()(const Device *d, const int ndim, const int lda, const T *A, const int neig, Real *w, T *z)
heevx computes the first m eigenvalues and their corresponding eigenvectors of a complex generalized ...
Definition hegvd_op.h:46
typename GetTypeReal< T >::type Real
Definition hegvd_op.h:47
void operator()(const Device *d, const int nstart, const int ldh, const T *A, T *B, Real *W, T *V)
HEGVD computes all the eigenvalues and eigenvectors of a complex generalized Hermitian-definite eigen...
Definition hegvd_op.h:89
void operator()(const Device *d, const int nstart, const int ldh, T *A, T *B, const int m, Real *W, T *V)
HEGVX computes first m eigenvalues and eigenvectors of a complex generalized Input Parameters.
typename GetTypeReal< T >::type Real
Definition hegvd_op.h:90