ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
bpcg_kernel_op.h
Go to the documentation of this file.
1#ifndef MODULE_HSOLVER_BPCG_KERNEL_H
2#define MODULE_HSOLVER_BPCG_KERNEL_H
5namespace hsolver
6{
7
8template <typename T, typename Device>
10{
24 void operator()(T* grad_out,
25 T* hgrad_out,
26 T* psi_out,
27 T* hpsi_out,
28 const int& n_basis,
29 const int& n_basis_max,
30 const int& n_band);
31};
32
33template <typename T, typename Device>
35{
49 using Real = typename GetTypeReal<T>::type;
50 void operator()(const Real* prec_in,
51 Real* err_out,
52 Real* beta_out,
53 T* psi_out,
54 T* hpsi_out,
55 T* grad_out,
56 T* grad_old_out,
57 const int& n_basis,
58 const int& n_basis_max,
59 const int& n_band);
60};
61
62template <typename T, typename Device>
64{
65 using Real = typename GetTypeReal<T>::type;
66 void operator()(const int& nbase,
67 const int& nbase_x,
68 const int& notconv,
69 T* result,
70 const T* vectors,
71 const Real* eigenvalues);
72};
73
74template <typename T, typename Device>
76 using Real = typename GetTypeReal<T>::type;
77 void operator()(const int& dim,
78 T* psi_iter,
79 const int& nbase,
80 const int& notconv,
81 const Real* precondition,
82 const Real* eigenvalues);
83};
84
85template <typename T, typename Device>
87 using Real = typename GetTypeReal<T>::type;
88 void operator()(const int& dim,
89 T* psi_iter,
90 const int& nbase,
91 const int& notconv,
92 Real* psi_norm = nullptr);
93};
94
95template <typename T, typename Device> struct refresh_hcc_scc_vcc_op {
96 using Real = typename GetTypeReal<T>::type;
110 void operator()(const int &n,
111 T *hcc,
112 T *scc,
113 T *vcc,
114 const int &ldh,
115 const Real *eigenvalue,
116 const T& one);
117};
118
119#if __CUDA || __UT_USE_CUDA || __ROCM || __UT_USE_ROCM
120
121template <typename T>
122struct line_minimize_with_block_op<T, base_device::DEVICE_GPU> {
123 using Real = typename GetTypeReal<T>::type;
124 void operator()(T *grad_out, T *hgrad_out, T *psi_out, T *hpsi_out,
125 const int &n_basis, const int &n_basis_max,
126 const int &n_band);
127};
128
129template <typename T>
130struct calc_grad_with_block_op<T, base_device::DEVICE_GPU> {
131 using Real = typename GetTypeReal<T>::type;
132 void operator()(const Real *prec_in, Real *err_out, Real *beta_out,
133 T *psi_out, T *hpsi_out, T *grad_out, T *grad_old_out,
134 const int &n_basis, const int &n_basis_max,
135 const int &n_band);
136};
137
138template <typename T>
139struct apply_eigenvalues_op<T, base_device::DEVICE_GPU> {
140 using Real = typename GetTypeReal<T>::type;
141 void operator()(const int& nbase,
142 const int& nbase_x,
143 const int& notconv,
144 T* result,
145 const T* vectors,
146 const Real* eigenvalues);
147};
148
149template <typename T>
150struct precondition_op<T, base_device::DEVICE_GPU> {
151 using Real = typename GetTypeReal<T>::type;
152 void operator()(const int& dim,
153 T* psi_iter,
154 const int& nbase,
155 const int& notconv,
156 const Real* precondition,
157 const Real* eigenvalues);
158};
159
160template <typename T>
161struct normalize_op<T, base_device::DEVICE_GPU> {
162 using Real = typename GetTypeReal<T>::type;
163 void operator()(const int& dim,
164 T* psi_iter,
165 const int& nbase,
166 const int& notconv,
167 Real* psi_norm = nullptr);
168};
169
170template <typename T>
171struct refresh_hcc_scc_vcc_op<T, base_device::DEVICE_GPU> {
172 using Real = typename GetTypeReal<T>::type;
173 void operator()(const int &n,
174 T *hcc,
175 T *scc,
176 T *vcc,
177 const int &ldh,
178 const Real *eigenvalue,
179 const T& one);
180};
181#endif
182} // namespace hsolver
183
184#endif
#define T
Definition exp.cpp:237
Definition device.cpp:21
Definition diag_comm_info.h:9
T type
Definition macros.h:8
Definition bpcg_kernel_op.h:64
typename GetTypeReal< T >::type Real
Definition bpcg_kernel_op.h:65
void operator()(const int &nbase, const int &nbase_x, const int &notconv, T *result, const T *vectors, const Real *eigenvalues)
Definition bpcg_kernel_op.h:35
void operator()(const Real *prec_in, Real *err_out, Real *beta_out, T *psi_out, T *hpsi_out, T *grad_out, T *grad_old_out, const int &n_basis, const int &n_basis_max, const int &n_band)
typename GetTypeReal< T >::type Real
dot_real_op computes the dot product of the given complex arrays(treated as float arrays)....
Definition bpcg_kernel_op.h:49
Definition bpcg_kernel_op.h:10
void operator()(T *grad_out, T *hgrad_out, T *psi_out, T *hpsi_out, const int &n_basis, const int &n_basis_max, const int &n_band)
dot_real_op computes the dot product of the given complex arrays(treated as float arrays)....
Definition bpcg_kernel_op.h:86
typename GetTypeReal< T >::type Real
Definition bpcg_kernel_op.h:87
void operator()(const int &dim, T *psi_iter, const int &nbase, const int &notconv, Real *psi_norm=nullptr)
Definition bpcg_kernel_op.h:75
void operator()(const int &dim, T *psi_iter, const int &nbase, const int &notconv, const Real *precondition, const Real *eigenvalues)
typename GetTypeReal< T >::type Real
Definition bpcg_kernel_op.h:76
Definition bpcg_kernel_op.h:95
typename GetTypeReal< T >::type Real
Definition bpcg_kernel_op.h:96
void operator()(const int &n, T *hcc, T *scc, T *vcc, const int &ldh, const Real *eigenvalue, const T &one)
refresh hcc scc vcc