Loading...
Searching...
No Matches
gpu_kernels_hip.cpp
Go to the documentation of this file.
2
3#include <hip/hip_complex.h>
4#include <hip/hip_runtime.h>
5
6namespace q3 {
7namespace diagonalizer {
8namespace planewave {
9namespace gpu {
10
11// ─── HIP Kernels ──────────────────────────────────────────────────────────
12
13__global__ void apply_kinetic_energy_kernel(int total_elements,
14 int number_of_plane_waves,
15 const double* kinetic_energy,
16 const hipDoubleComplex* psi,
17 hipDoubleComplex* hpsi) {
18 int index = blockIdx.x * blockDim.x + threadIdx.x;
19 if (index < total_elements) {
20 int g_index = index % number_of_plane_waves;
21 double ke = kinetic_energy[g_index];
22 hipDoubleComplex p = psi[index];
23 hpsi[index] = make_hipDoubleComplex(ke * p.x, ke * p.y);
24 }
25}
26
27__global__ void apply_kinetic_energy_single_kernel(int total_elements,
28 int number_of_plane_waves,
29 const float* kinetic_energy,
30 const hipComplex* psi,
31 hipComplex* hpsi) {
32 int index = blockIdx.x * blockDim.x + threadIdx.x;
33 if (index < total_elements) {
34 int g_index = index % number_of_plane_waves;
35 float ke = kinetic_energy[g_index];
36 hipComplex p = psi[index];
37 hpsi[index] = make_hipFloatComplex(ke * p.x, ke * p.y);
38 }
39}
40
41__global__ void scatter_g_to_fft_grid_kernel(int total_elements,
42 int number_of_plane_waves,
43 int local_smooth_grid_points,
44 const int* g_to_fft_mapping,
45 const int* minus_g_to_fft_mapping,
46 bool is_gamma_only,
47 const hipDoubleComplex* psi,
48 hipDoubleComplex* fft_workspace) {
49 int index = blockIdx.x * blockDim.x + threadIdx.x;
50 if (index < total_elements) {
51 int vector_index = index / number_of_plane_waves;
52 int g_index = index % number_of_plane_waves;
53 hipDoubleComplex val = psi[index];
54 int fft_index = g_to_fft_mapping[g_index];
55 if (fft_index >= 0) {
56 fft_workspace[vector_index * local_smooth_grid_points + fft_index] = val;
57 }
58 if (is_gamma_only && g_index > 0 && minus_g_to_fft_mapping != nullptr) {
59 int fft_minus = minus_g_to_fft_mapping[g_index];
60 if (fft_minus >= 0) {
61 fft_workspace[vector_index * local_smooth_grid_points + fft_minus] =
62 make_hipDoubleComplex(val.x, -val.y);
63 }
64 }
65 }
66}
67
68__global__ void scatter_g_to_fft_grid_single_kernel(int total_elements,
69 int number_of_plane_waves,
70 int local_smooth_grid_points,
71 const int* g_to_fft_mapping,
72 const int* minus_g_to_fft_mapping,
73 bool is_gamma_only,
74 const hipComplex* psi,
75 hipComplex* fft_workspace) {
76 int index = blockIdx.x * blockDim.x + threadIdx.x;
77 if (index < total_elements) {
78 int vector_index = index / number_of_plane_waves;
79 int g_index = index % number_of_plane_waves;
80 hipComplex val = psi[index];
81 int fft_index = g_to_fft_mapping[g_index];
82 if (fft_index >= 0) {
83 fft_workspace[vector_index * local_smooth_grid_points + fft_index] = val;
84 }
85 if (is_gamma_only && g_index > 0 && minus_g_to_fft_mapping != nullptr) {
86 int fft_minus = minus_g_to_fft_mapping[g_index];
87 if (fft_minus >= 0) {
88 fft_workspace[vector_index * local_smooth_grid_points + fft_minus] =
89 make_hipFloatComplex(val.x, -val.y);
90 }
91 }
92 }
93}
94
95__global__ void scatter_g_to_fft_grid_mixed_kernel(int total_elements,
96 int number_of_plane_waves,
97 int local_smooth_grid_points,
98 const int* g_to_fft_mapping,
99 const int* minus_g_to_fft_mapping,
100 bool is_gamma_only,
101 const hipDoubleComplex* psi,
102 hipComplex* fft_workspace) {
103 int index = blockIdx.x * blockDim.x + threadIdx.x;
104 if (index < total_elements) {
105 int vector_index = index / number_of_plane_waves;
106 int g_index = index % number_of_plane_waves;
107 hipDoubleComplex val = psi[index];
108 int fft_index = g_to_fft_mapping[g_index];
109 if (fft_index >= 0) {
110 fft_workspace[vector_index * local_smooth_grid_points + fft_index] =
111 make_hipFloatComplex((float)val.x, (float)val.y);
112 }
113 if (is_gamma_only && g_index > 0 && minus_g_to_fft_mapping != nullptr) {
114 int fft_minus = minus_g_to_fft_mapping[g_index];
115 if (fft_minus >= 0) {
116 fft_workspace[vector_index * local_smooth_grid_points + fft_minus] =
117 make_hipFloatComplex((float)val.x, -(float)val.y);
118 }
119 }
120 }
121}
122
123__global__ void multiply_potential_kernel(int total_elements,
124 int local_smooth_grid_points,
125 const double* potential,
126 hipDoubleComplex* fft_workspace) {
127 int index = blockIdx.x * blockDim.x + threadIdx.x;
128 if (index < total_elements) {
129 int grid_index = index % local_smooth_grid_points;
130 double pot = potential[grid_index];
131 hipDoubleComplex val = fft_workspace[index];
132 fft_workspace[index] = make_hipDoubleComplex(val.x * pot, val.y * pot);
133 }
134}
135
136__global__ void multiply_potential_single_kernel(int total_elements,
137 int local_smooth_grid_points,
138 const float* potential,
139 hipComplex* fft_workspace) {
140 int index = blockIdx.x * blockDim.x + threadIdx.x;
141 if (index < total_elements) {
142 int grid_index = index % local_smooth_grid_points;
143 float pot = potential[grid_index];
144 hipComplex val = fft_workspace[index];
145 fft_workspace[index] = make_hipFloatComplex(val.x * pot, val.y * pot);
146 }
147}
148
149__global__ void gather_fft_grid_to_g_kernel(int total_elements,
150 int number_of_plane_waves,
151 int local_smooth_grid_points,
152 const int* g_to_fft_mapping,
153 const hipDoubleComplex* fft_workspace,
154 hipDoubleComplex* hpsi) {
155 int index = blockIdx.x * blockDim.x + threadIdx.x;
156 if (index < total_elements) {
157 int vector_index = index / number_of_plane_waves;
158 int g_index = index % number_of_plane_waves;
159 int fft_index = g_to_fft_mapping[g_index];
160 if (fft_index >= 0) {
161 hipDoubleComplex val =
162 fft_workspace[vector_index * local_smooth_grid_points + fft_index];
163 hipDoubleComplex current = hpsi[index];
164 hpsi[index] = make_hipDoubleComplex(current.x + val.x, current.y + val.y);
165 }
166 }
167}
168
169__global__ void gather_fft_grid_to_g_single_kernel(int total_elements,
170 int number_of_plane_waves,
171 int local_smooth_grid_points,
172 const int* g_to_fft_mapping,
173 const hipComplex* fft_workspace,
174 hipComplex* hpsi) {
175 int index = blockIdx.x * blockDim.x + threadIdx.x;
176 if (index < total_elements) {
177 int vector_index = index / number_of_plane_waves;
178 int g_index = index % number_of_plane_waves;
179 int fft_index = g_to_fft_mapping[g_index];
180 if (fft_index >= 0) {
181 hipComplex val = fft_workspace[vector_index * local_smooth_grid_points + fft_index];
182 hipComplex current = hpsi[index];
183 hpsi[index] = make_hipFloatComplex(current.x + val.x, current.y + val.y);
184 }
185 }
186}
187
188__global__ void gather_fft_grid_to_g_mixed_kernel(int total_elements,
189 int number_of_plane_waves,
190 int local_smooth_grid_points,
191 const int* g_to_fft_mapping,
192 const hipComplex* fft_workspace,
193 hipDoubleComplex* hpsi) {
194 int index = blockIdx.x * blockDim.x + threadIdx.x;
195 if (index < total_elements) {
196 int vector_index = index / number_of_plane_waves;
197 int g_index = index % number_of_plane_waves;
198 int fft_index = g_to_fft_mapping[g_index];
199 if (fft_index >= 0) {
200 hipComplex val = fft_workspace[vector_index * local_smooth_grid_points + fft_index];
201 hipDoubleComplex current = hpsi[index];
202 hpsi[index] =
203 make_hipDoubleComplex(current.x + (double)val.x, current.y + (double)val.y);
204 }
205 }
206}
207
208__global__ void compute_residuals_kernel(int total_elements,
209 int number_of_plane_waves,
210 const double* eigenvalues,
211 const hipDoubleComplex* hamiltonian_ritz_vectors,
212 const hipDoubleComplex* overlap_ritz_vectors,
213 hipDoubleComplex* residual_wavefunctions) {
214 int index = blockIdx.x * blockDim.x + threadIdx.x;
215 if (index < total_elements) {
216 int band_index = index / number_of_plane_waves;
217 double eig = eigenvalues[band_index];
218 hipDoubleComplex h_ritz = hamiltonian_ritz_vectors[index];
219 hipDoubleComplex s_ritz = overlap_ritz_vectors[index];
220 residual_wavefunctions[index] =
221 make_hipDoubleComplex(h_ritz.x - eig * s_ritz.x, h_ritz.y - eig * s_ritz.y);
222 }
223}
224
225__global__ void apply_preconditioner_kernel(int total_elements,
226 int number_of_plane_waves,
227 const double* kinetic_energy_squared,
228 const double* eigenvalues,
229 const bool* band_converged,
230 double floor_value,
231 hipDoubleComplex* residual_wavefunctions) {
232 int index = blockIdx.x * blockDim.x + threadIdx.x;
233 if (index < total_elements) {
234 int band_index = index / number_of_plane_waves;
235 if (band_converged[band_index]) {
236 return;
237 }
238 int g_index = index % number_of_plane_waves;
239 double value_x = kinetic_energy_squared[g_index] - eigenvalues[band_index];
240 double denominator = 0.5 * (1.0 + value_x + sqrt(1.0 + (value_x - 1.0) * (value_x - 1.0)));
241 if (denominator < floor_value) {
242 denominator = floor_value;
243 }
244 hipDoubleComplex res = residual_wavefunctions[index];
245 residual_wavefunctions[index] =
246 make_hipDoubleComplex(res.x / denominator, res.y / denominator);
247 }
248}
249
250// ─── HIP Launchers ──────────────────────────────────────────────────────────
251
252void launch_apply_kinetic_energy(int number_of_vectors,
253 int number_of_plane_waves,
254 const double* kinetic_energy,
255 const std::complex<double>* psi,
256 std::complex<double>* hpsi) {
257 int total_elements = number_of_vectors * number_of_plane_waves;
258 if (total_elements == 0)
259 return;
260 int threads = 256;
261 int blocks = (total_elements + threads - 1) / threads;
262 hipLaunchKernelGGL(apply_kinetic_energy_kernel,
263 blocks,
264 threads,
265 0,
266 0,
267 total_elements,
268 number_of_plane_waves,
269 kinetic_energy,
270 reinterpret_cast<const hipDoubleComplex*>(psi),
271 reinterpret_cast<hipDoubleComplex*>(hpsi));
272}
273
274void launch_apply_kinetic_energy_single(int number_of_vectors,
275 int number_of_plane_waves,
276 const float* kinetic_energy,
277 const std::complex<float>* psi,
278 std::complex<float>* hpsi) {
279 int total_elements = number_of_vectors * number_of_plane_waves;
280 if (total_elements == 0)
281 return;
282 int threads = 256;
283 int blocks = (total_elements + threads - 1) / threads;
284 hipLaunchKernelGGL(apply_kinetic_energy_single_kernel,
285 blocks,
286 threads,
287 0,
288 0,
289 total_elements,
290 number_of_plane_waves,
291 kinetic_energy,
292 reinterpret_cast<const hipComplex*>(psi),
293 reinterpret_cast<hipComplex*>(hpsi));
294}
295
296void launch_scatter_g_to_fft_grid(int number_of_vectors,
297 int number_of_plane_waves,
298 int local_smooth_grid_points,
299 const int* g_to_fft_mapping,
300 const int* minus_g_to_fft_mapping,
301 bool is_gamma_only,
302 const std::complex<double>* psi,
303 std::complex<double>* fft_workspace) {
304 int total_elements = number_of_vectors * number_of_plane_waves;
305 if (total_elements == 0)
306 return;
307 hipMemset(fft_workspace,
308 0,
309 number_of_vectors * local_smooth_grid_points * sizeof(std::complex<double>));
310 int threads = 256;
311 int blocks = (total_elements + threads - 1) / threads;
312 hipLaunchKernelGGL(scatter_g_to_fft_grid_kernel,
313 blocks,
314 threads,
315 0,
316 0,
317 total_elements,
318 number_of_plane_waves,
319 local_smooth_grid_points,
320 g_to_fft_mapping,
321 minus_g_to_fft_mapping,
322 is_gamma_only,
323 reinterpret_cast<const hipDoubleComplex*>(psi),
324 reinterpret_cast<hipDoubleComplex*>(fft_workspace));
325}
326
327void launch_scatter_g_to_fft_grid_single(int number_of_vectors,
328 int number_of_plane_waves,
329 int local_smooth_grid_points,
330 const int* g_to_fft_mapping,
331 const int* minus_g_to_fft_mapping,
332 bool is_gamma_only,
333 const std::complex<float>* psi,
334 std::complex<float>* fft_workspace) {
335 int total_elements = number_of_vectors * number_of_plane_waves;
336 if (total_elements == 0)
337 return;
338 hipMemset(fft_workspace,
339 0,
340 number_of_vectors * local_smooth_grid_points * sizeof(std::complex<float>));
341 int threads = 256;
342 int blocks = (total_elements + threads - 1) / threads;
343 hipLaunchKernelGGL(scatter_g_to_fft_grid_single_kernel,
344 blocks,
345 threads,
346 0,
347 0,
348 total_elements,
349 number_of_plane_waves,
350 local_smooth_grid_points,
351 g_to_fft_mapping,
352 minus_g_to_fft_mapping,
353 is_gamma_only,
354 reinterpret_cast<const hipComplex*>(psi),
355 reinterpret_cast<hipComplex*>(fft_workspace));
356}
357
358void launch_scatter_g_to_fft_grid_mixed(int number_of_vectors,
359 int number_of_plane_waves,
360 int local_smooth_grid_points,
361 const int* g_to_fft_mapping,
362 const int* minus_g_to_fft_mapping,
363 bool is_gamma_only,
364 const std::complex<double>* psi,
365 std::complex<float>* fft_workspace) {
366 int total_elements = number_of_vectors * number_of_plane_waves;
367 if (total_elements == 0)
368 return;
369 hipMemset(fft_workspace,
370 0,
371 number_of_vectors * local_smooth_grid_points * sizeof(std::complex<float>));
372 int threads = 256;
373 int blocks = (total_elements + threads - 1) / threads;
374 hipLaunchKernelGGL(scatter_g_to_fft_grid_mixed_kernel,
375 blocks,
376 threads,
377 0,
378 0,
379 total_elements,
380 number_of_plane_waves,
381 local_smooth_grid_points,
382 g_to_fft_mapping,
383 minus_g_to_fft_mapping,
384 is_gamma_only,
385 reinterpret_cast<const hipDoubleComplex*>(psi),
386 reinterpret_cast<hipComplex*>(fft_workspace));
387}
388
389void launch_multiply_potential(int number_of_vectors,
390 int local_smooth_grid_points,
391 const double* potential,
392 std::complex<double>* fft_workspace) {
393 int total_elements = number_of_vectors * local_smooth_grid_points;
394 if (total_elements == 0)
395 return;
396 int threads = 256;
397 int blocks = (total_elements + threads - 1) / threads;
398 hipLaunchKernelGGL(multiply_potential_kernel,
399 blocks,
400 threads,
401 0,
402 0,
403 total_elements,
404 local_smooth_grid_points,
405 potential,
406 reinterpret_cast<hipDoubleComplex*>(fft_workspace));
407}
408
409void launch_multiply_potential_single(int number_of_vectors,
410 int local_smooth_grid_points,
411 const float* potential,
412 std::complex<float>* fft_workspace) {
413 int total_elements = number_of_vectors * local_smooth_grid_points;
414 if (total_elements == 0)
415 return;
416 int threads = 256;
417 int blocks = (total_elements + threads - 1) / threads;
418 hipLaunchKernelGGL(multiply_potential_single_kernel,
419 blocks,
420 threads,
421 0,
422 0,
423 total_elements,
424 local_smooth_grid_points,
425 potential,
426 reinterpret_cast<hipComplex*>(fft_workspace));
427}
428
429void launch_gather_fft_grid_to_g(int number_of_vectors,
430 int number_of_plane_waves,
431 int local_smooth_grid_points,
432 const int* g_to_fft_mapping,
433 const std::complex<double>* fft_workspace,
434 std::complex<double>* hpsi) {
435 int total_elements = number_of_vectors * number_of_plane_waves;
436 if (total_elements == 0)
437 return;
438 int threads = 256;
439 int blocks = (total_elements + threads - 1) / threads;
440 hipLaunchKernelGGL(gather_fft_grid_to_g_kernel,
441 blocks,
442 threads,
443 0,
444 0,
445 total_elements,
446 number_of_plane_waves,
447 local_smooth_grid_points,
448 g_to_fft_mapping,
449 reinterpret_cast<const hipDoubleComplex*>(fft_workspace),
450 reinterpret_cast<hipDoubleComplex*>(hpsi));
451}
452
453void launch_gather_fft_grid_to_g_single(int number_of_vectors,
454 int number_of_plane_waves,
455 int local_smooth_grid_points,
456 const int* g_to_fft_mapping,
457 const std::complex<float>* fft_workspace,
458 std::complex<float>* hpsi) {
459 int total_elements = number_of_vectors * number_of_plane_waves;
460 if (total_elements == 0)
461 return;
462 int threads = 256;
463 int blocks = (total_elements + threads - 1) / threads;
464 hipLaunchKernelGGL(gather_fft_grid_to_g_single_kernel,
465 blocks,
466 threads,
467 0,
468 0,
469 total_elements,
470 number_of_plane_waves,
471 local_smooth_grid_points,
472 g_to_fft_mapping,
473 reinterpret_cast<const hipComplex*>(fft_workspace),
474 reinterpret_cast<hipComplex*>(hpsi));
475}
476
477void launch_gather_fft_grid_to_g_mixed(int number_of_vectors,
478 int number_of_plane_waves,
479 int local_smooth_grid_points,
480 const int* g_to_fft_mapping,
481 const std::complex<float>* fft_workspace,
482 std::complex<double>* hpsi) {
483 int total_elements = number_of_vectors * number_of_plane_waves;
484 if (total_elements == 0)
485 return;
486 int threads = 256;
487 int blocks = (total_elements + threads - 1) / threads;
488 hipLaunchKernelGGL(gather_fft_grid_to_g_mixed_kernel,
489 blocks,
490 threads,
491 0,
492 0,
493 total_elements,
494 number_of_plane_waves,
495 local_smooth_grid_points,
496 g_to_fft_mapping,
497 reinterpret_cast<const hipComplex*>(fft_workspace),
498 reinterpret_cast<hipDoubleComplex*>(hpsi));
499}
500
501void launch_compute_residuals(int number_of_bands,
502 int number_of_plane_waves,
503 const double* eigenvalues,
504 const std::complex<double>* hamiltonian_ritz_vectors,
505 const std::complex<double>* overlap_ritz_vectors,
506 std::complex<double>* residual_wavefunctions) {
507 int total_elements = number_of_bands * number_of_plane_waves;
508 if (total_elements == 0)
509 return;
510 int threads = 256;
511 int blocks = (total_elements + threads - 1) / threads;
512 hipLaunchKernelGGL(compute_residuals_kernel,
513 blocks,
514 threads,
515 0,
516 0,
517 total_elements,
518 number_of_plane_waves,
519 eigenvalues,
520 reinterpret_cast<const hipDoubleComplex*>(hamiltonian_ritz_vectors),
521 reinterpret_cast<const hipDoubleComplex*>(overlap_ritz_vectors),
522 reinterpret_cast<hipDoubleComplex*>(residual_wavefunctions));
523}
524
525void launch_apply_preconditioner(int number_of_bands,
526 int number_of_plane_waves,
527 const double* kinetic_energy_squared,
528 const double* eigenvalues,
529 const bool* band_converged,
530 double floor_value,
531 std::complex<double>* residual_wavefunctions) {
532 int total_elements = number_of_bands * number_of_plane_waves;
533 if (total_elements == 0)
534 return;
535 int threads = 256;
536 int blocks = (total_elements + threads - 1) / threads;
537 hipLaunchKernelGGL(apply_preconditioner_kernel,
538 blocks,
539 threads,
540 0,
541 0,
542 total_elements,
543 number_of_plane_waves,
544 kinetic_energy_squared,
545 eigenvalues,
546 band_converged,
547 floor_value,
548 reinterpret_cast<hipDoubleComplex*>(residual_wavefunctions));
549}
550
551} // namespace gpu
552} // namespace planewave
553} // namespace diagonalizer
554} // namespace q3
void launch_apply_preconditioner(int number_of_bands, int number_of_plane_waves, const double *kinetic_energy_squared, const double *eigenvalues, const bool *band_converged, double floor_value, std::complex< double > *residual_wavefunctions)
__global__ void gather_fft_grid_to_g_kernel(int total_elements, int number_of_plane_waves, int local_smooth_grid_points, const int *g_to_fft_mapping, const hipDoubleComplex *fft_workspace, hipDoubleComplex *hpsi)
void launch_apply_kinetic_energy_single(int number_of_vectors, int number_of_plane_waves, const float *kinetic_energy, const std::complex< float > *psi, std::complex< float > *hpsi)
void launch_gather_fft_grid_to_g_single(int number_of_vectors, int number_of_plane_waves, int local_smooth_grid_points, const int *g_to_fft_mapping, const std::complex< float > *fft_workspace, std::complex< float > *hpsi)
void launch_apply_kinetic_energy(int number_of_vectors, int number_of_plane_waves, const double *kinetic_energy, const std::complex< double > *psi, std::complex< double > *hpsi)
__global__ void multiply_potential_single_kernel(int total_elements, int local_smooth_grid_points, const float *potential, hipComplex *fft_workspace)
__global__ void gather_fft_grid_to_g_single_kernel(int total_elements, int number_of_plane_waves, int local_smooth_grid_points, const int *g_to_fft_mapping, const hipComplex *fft_workspace, hipComplex *hpsi)
__global__ void compute_residuals_kernel(int total_elements, int number_of_plane_waves, const double *eigenvalues, const hipDoubleComplex *hamiltonian_ritz_vectors, const hipDoubleComplex *overlap_ritz_vectors, hipDoubleComplex *residual_wavefunctions)
__global__ void gather_fft_grid_to_g_mixed_kernel(int total_elements, int number_of_plane_waves, int local_smooth_grid_points, const int *g_to_fft_mapping, const hipComplex *fft_workspace, hipDoubleComplex *hpsi)
void launch_multiply_potential(int number_of_vectors, int local_smooth_grid_points, const double *potential, std::complex< double > *fft_workspace)
__global__ void apply_preconditioner_kernel(int total_elements, int number_of_plane_waves, const double *kinetic_energy_squared, const double *eigenvalues, const bool *band_converged, double floor_value, hipDoubleComplex *residual_wavefunctions)
void launch_multiply_potential_single(int number_of_vectors, int local_smooth_grid_points, const float *potential, std::complex< float > *fft_workspace)
__global__ void scatter_g_to_fft_grid_kernel(int total_elements, int number_of_plane_waves, int local_smooth_grid_points, const int *g_to_fft_mapping, const int *minus_g_to_fft_mapping, bool is_gamma_only, const hipDoubleComplex *psi, hipDoubleComplex *fft_workspace)
void launch_gather_fft_grid_to_g_mixed(int number_of_vectors, int number_of_plane_waves, int local_smooth_grid_points, const int *g_to_fft_mapping, const std::complex< float > *fft_workspace, std::complex< double > *hpsi)
__global__ void apply_kinetic_energy_kernel(int total_elements, int number_of_plane_waves, const double *kinetic_energy, const hipDoubleComplex *psi, hipDoubleComplex *hpsi)
__global__ void apply_kinetic_energy_single_kernel(int total_elements, int number_of_plane_waves, const float *kinetic_energy, const hipComplex *psi, hipComplex *hpsi)
void launch_scatter_g_to_fft_grid(int number_of_vectors, int number_of_plane_waves, int local_smooth_grid_points, const int *g_to_fft_mapping, const int *minus_g_to_fft_mapping, bool is_gamma_only, const std::complex< double > *psi, std::complex< double > *fft_workspace)
__global__ void scatter_g_to_fft_grid_mixed_kernel(int total_elements, int number_of_plane_waves, int local_smooth_grid_points, const int *g_to_fft_mapping, const int *minus_g_to_fft_mapping, bool is_gamma_only, const hipDoubleComplex *psi, hipComplex *fft_workspace)
void launch_gather_fft_grid_to_g(int number_of_vectors, int number_of_plane_waves, int local_smooth_grid_points, const int *g_to_fft_mapping, const std::complex< double > *fft_workspace, std::complex< double > *hpsi)
void launch_compute_residuals(int number_of_bands, int number_of_plane_waves, const double *eigenvalues, const std::complex< double > *hamiltonian_ritz_vectors, const std::complex< double > *overlap_ritz_vectors, std::complex< double > *residual_wavefunctions)
void launch_scatter_g_to_fft_grid_mixed(int number_of_vectors, int number_of_plane_waves, int local_smooth_grid_points, const int *g_to_fft_mapping, const int *minus_g_to_fft_mapping, bool is_gamma_only, const std::complex< double > *psi, std::complex< float > *fft_workspace)
void launch_scatter_g_to_fft_grid_single(int number_of_vectors, int number_of_plane_waves, int local_smooth_grid_points, const int *g_to_fft_mapping, const int *minus_g_to_fft_mapping, bool is_gamma_only, const std::complex< float > *psi, std::complex< float > *fft_workspace)
__global__ void scatter_g_to_fft_grid_single_kernel(int total_elements, int number_of_plane_waves, int local_smooth_grid_points, const int *g_to_fft_mapping, const int *minus_g_to_fft_mapping, bool is_gamma_only, const hipComplex *psi, hipComplex *fft_workspace)
__global__ void multiply_potential_kernel(int total_elements, int local_smooth_grid_points, const double *potential, hipDoubleComplex *fft_workspace)