ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
pw_op.h
Go to the documentation of this file.
1#ifndef MODULE_PW_MULTI_DEVICE_H
2#define MODULE_PW_MULTI_DEVICE_H
3
4#include "source_psi/psi.h"
5#include <complex>
6
7namespace ModulePW {
8template <typename FPTYPE, typename Device>
22 const int npwk,
23 const int* box_index,
24 const std::complex<FPTYPE>* in,
25 std::complex<FPTYPE>* out);
26};
27
28template <typename FPTYPE, typename Device>
41 const int nrxx,
42 const bool add,
43 const FPTYPE factor,
44 const std::complex<FPTYPE>* in,
45 std::complex<FPTYPE>* out);
46
48 const int nrxx,
49 const bool add,
50 const FPTYPE factor,
51 const std::complex<FPTYPE>* in,
52 FPTYPE* out);
53};
54
55template <typename FPTYPE, typename Device>
70 const int npw_k,
71 const int nxyz,
72 const bool add,
73 const FPTYPE factor,
74 const int* box_index,
75 const std::complex<FPTYPE>* in,
76 std::complex<FPTYPE>* out);
77
79 const int npw_k,
80 const int nxyz,
81 const bool add,
82 const FPTYPE factor,
83 const int* box_index,
84 const std::complex<FPTYPE>* in,
85 FPTYPE* out);
86};
87
88#if __CUDA || __UT_USE_CUDA || __ROCM || __UT_USE_ROCM
89// Partially specialize functor for base_device::GpuDevice.
90template <typename FPTYPE>
91struct set_3d_fft_box_op<FPTYPE, base_device::DEVICE_GPU>
92{
93 void operator()(const int npwk,
94 const int* box_index,
95 const std::complex<FPTYPE>* in,
96 std::complex<FPTYPE>* out);
97};
98
99template <typename FPTYPE>
100struct set_recip_to_real_output_op<FPTYPE, base_device::DEVICE_GPU>
101{
102 void operator()(const int nrxx,
103 const bool add,
104 const FPTYPE factor,
105 const std::complex<FPTYPE>* in,
106 std::complex<FPTYPE>* out);
107
108 void operator()(const int nrxx,
109 const bool add,
110 const FPTYPE factor,
111 const std::complex<FPTYPE>* in,
112 FPTYPE* out);
113};
114
115template <typename FPTYPE>
116struct set_real_to_recip_output_op<FPTYPE, base_device::DEVICE_GPU>
117{
118 void operator()(const int npw_k,
119 const int nxyz,
120 const bool add,
121 const FPTYPE factor,
122 const int* box_index,
123 const std::complex<FPTYPE>* in,
124 std::complex<FPTYPE>* out);
125 void operator()(const int npw_k,
126 const int nxyz,
127 const bool add,
128 const FPTYPE factor,
129 const int* box_index,
130 const std::complex<FPTYPE>* in,
131 FPTYPE* out);
132};
133
134#endif // __CUDA || __UT_USE_CUDA || __ROCM || __UT_USE_ROCM
135} // namespace ModulePW
136#endif //MODULE_PW_MULTI_DEVICE_H
Definition pw_op.cpp:3
Definition device.cpp:21
Definition pw_op.h:9
void operator()(const int npwk, const int *box_index, const std::complex< FPTYPE > *in, std::complex< FPTYPE > *out)
Set the 3D fft box for fft transfrom between the recip and real space. To map the 1D psi(1D continuou...
void operator()(const int npw_k, const int nxyz, const bool add, const FPTYPE factor, const int *box_index, const std::complex< FPTYPE > *in, std::complex< FPTYPE > *out)
Calculate the outputs after the FFT translation of real_to_recip.
void operator()(const int nrxx, const bool add, const FPTYPE factor, const std::complex< FPTYPE > *in, std::complex< FPTYPE > *out)
Calculate the outputs after the FFT translation of recip_to_real.