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* sgrad_out,
27 T* psi_out,
28 T* hpsi_out,
29 T* spsi_out,
30 const int& n_basis,
31 const int& n_basis_max,
32 const int& n_band);
33};
34
35template <typename T, typename Device>
37{
51 using Real = typename GetTypeReal<T>::type;
52 void operator()(const Real* prec_in,
53 Real* err_out,
54 Real* beta_out,
55 T* psi_out,
56 T* hpsi_out,
57 T* spsi_out,
58 T* grad_out,
59 T* grad_old_out,
60 const int& n_basis,
61 const int& n_basis_max,
62 const int& n_band);
63};
64
65template <typename T, typename Device>
67{
68 using Real = typename GetTypeReal<T>::type;
69 void operator()(const int& nbase,
70 const int& nbase_x,
71 const int& notconv,
72 T* result,
73 const T* vectors,
74 const Real* eigenvalues);
75};
76
77template <typename T, typename Device>
79 using Real = typename GetTypeReal<T>::type;
80 void operator()(const int& dim,
81 T* psi_iter,
82 const int& nbase,
83 const int& notconv,
84 const Real* precondition,
85 const Real* eigenvalues);
86};
87
88template <typename T, typename Device>
90 using Real = typename GetTypeReal<T>::type;
91 void operator()(const int& dim,
92 T* psi_iter,
93 const int& nbase,
94 const int& notconv,
95 Real* psi_norm = nullptr);
96};
97
98template <typename T, typename Device> struct refresh_hcc_scc_vcc_op {
99 using Real = typename GetTypeReal<T>::type;
113 void operator()(const int &n,
114 T *hcc,
115 T *scc,
116 T *vcc,
117 const int &ldh,
118 const Real *eigenvalue,
119 const T& one);
120};
121
122#if __CUDA || __UT_USE_CUDA || __ROCM || __UT_USE_ROCM
123
124template <typename T>
125struct line_minimize_with_block_op<T, base_device::DEVICE_GPU> {
126 using Real = typename GetTypeReal<T>::type;
127 void operator()(T *grad_out, T *hgrad_out, T *sgrad_out,
128 T *psi_out, T *hpsi_out, T *spsi_out,
129 const int &n_basis, const int &n_basis_max,
130 const int &n_band);
131};
132
133template <typename T>
134struct calc_grad_with_block_op<T, base_device::DEVICE_GPU> {
135 using Real = typename GetTypeReal<T>::type;
136 void operator()(const Real *prec_in, Real *err_out, Real *beta_out,
137 T *psi_out, T *hpsi_out, T *spsi_out,
138 T *grad_out, T *grad_old_out,
139 const int &n_basis, const int &n_basis_max,
140 const int &n_band);
141};
142
143template <typename T>
144struct apply_eigenvalues_op<T, base_device::DEVICE_GPU> {
145 using Real = typename GetTypeReal<T>::type;
146 void operator()(const int& nbase,
147 const int& nbase_x,
148 const int& notconv,
149 T* result,
150 const T* vectors,
151 const Real* eigenvalues);
152};
153
154template <typename T>
155struct precondition_op<T, base_device::DEVICE_GPU> {
156 using Real = typename GetTypeReal<T>::type;
157 void operator()(const int& dim,
158 T* psi_iter,
159 const int& nbase,
160 const int& notconv,
161 const Real* precondition,
162 const Real* eigenvalues);
163};
164
165template <typename T>
166struct normalize_op<T, base_device::DEVICE_GPU> {
167 using Real = typename GetTypeReal<T>::type;
168 void operator()(const int& dim,
169 T* psi_iter,
170 const int& nbase,
171 const int& notconv,
172 Real* psi_norm = nullptr);
173};
174
175template <typename T>
176struct refresh_hcc_scc_vcc_op<T, base_device::DEVICE_GPU> {
177 using Real = typename GetTypeReal<T>::type;
178 void operator()(const int &n,
179 T *hcc,
180 T *scc,
181 T *vcc,
182 const int &ldh,
183 const Real *eigenvalue,
184 const T& one);
185};
186#endif
187} // namespace hsolver
188
189#endif
#define T
Definition exp.cpp:237
Definition device.cpp:21
Definition dense_eigensolver.cpp:23
T DiagoIterAssist< T, Device >::one
Definition diago_iter_assist.h:179
T type
Definition macros.h:8
Definition bpcg_kernel_op.h:67
typename GetTypeReal< T >::type Real
Definition bpcg_kernel_op.h:68
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:37
void operator()(const Real *prec_in, Real *err_out, Real *beta_out, T *psi_out, T *hpsi_out, T *spsi_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:51
Definition bpcg_kernel_op.h:10
void operator()(T *grad_out, T *hgrad_out, T *sgrad_out, T *psi_out, T *hpsi_out, T *spsi_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:89
typename GetTypeReal< T >::type Real
Definition bpcg_kernel_op.h:90
void operator()(const int &dim, T *psi_iter, const int &nbase, const int &notconv, Real *psi_norm=nullptr)
Definition bpcg_kernel_op.h:78
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:79
Definition bpcg_kernel_op.h:98
typename GetTypeReal< T >::type Real
Definition bpcg_kernel_op.h:99
void operator()(const int &n, T *hcc, T *scc, T *vcc, const int &ldh, const Real *eigenvalue, const T &one)
refresh hcc scc vcc