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
5
6#include <complex>
7
8namespace ModulePW {
9template <typename FPTYPE, typename Device>
23 const int npwk,
24 const int* box_index,
25 const std::complex<FPTYPE>* in,
26 std::complex<FPTYPE>* out);
27};
28
29template <typename FPTYPE, typename Device>
42 const int nrxx,
43 const bool add,
44 const FPTYPE factor,
45 const std::complex<FPTYPE>* in,
46 std::complex<FPTYPE>* out);
47
49 const int nrxx,
50 const bool add,
51 const FPTYPE factor,
52 const std::complex<FPTYPE>* in,
53 FPTYPE* out);
54};
55
56template <typename FPTYPE, typename Device>
71 const int npw_k,
72 const int nxyz,
73 const bool add,
74 const FPTYPE factor,
75 const int* box_index,
76 const std::complex<FPTYPE>* in,
77 std::complex<FPTYPE>* out);
78
80 const int npw_k,
81 const int nxyz,
82 const bool add,
83 const FPTYPE factor,
84 const int* box_index,
85 const std::complex<FPTYPE>* in,
86 FPTYPE* out);
87};
88
89#if __CUDA || __UT_USE_CUDA || __ROCM || __UT_USE_ROCM
90// Partially specialize functor for base_device::GpuDevice.
91template <typename FPTYPE>
92struct set_3d_fft_box_op<FPTYPE, base_device::DEVICE_GPU>
93{
94 void operator()(const int npwk,
95 const int* box_index,
96 const std::complex<FPTYPE>* in,
97 std::complex<FPTYPE>* out);
98};
99
100template <typename FPTYPE>
101struct set_recip_to_real_output_op<FPTYPE, base_device::DEVICE_GPU>
102{
103 void operator()(const int nrxx,
104 const bool add,
105 const FPTYPE factor,
106 const std::complex<FPTYPE>* in,
107 std::complex<FPTYPE>* out);
108
109 void operator()(const int nrxx,
110 const bool add,
111 const FPTYPE factor,
112 const std::complex<FPTYPE>* in,
113 FPTYPE* out);
114};
115
116template <typename FPTYPE>
117struct set_real_to_recip_output_op<FPTYPE, base_device::DEVICE_GPU>
118{
119 void operator()(const int npw_k,
120 const int nxyz,
121 const bool add,
122 const FPTYPE factor,
123 const int* box_index,
124 const std::complex<FPTYPE>* in,
125 std::complex<FPTYPE>* out);
126 void operator()(const int npw_k,
127 const int nxyz,
128 const bool add,
129 const FPTYPE factor,
130 const int* box_index,
131 const std::complex<FPTYPE>* in,
132 FPTYPE* out);
133};
134
135#endif // __CUDA || __UT_USE_CUDA || __ROCM || __UT_USE_ROCM
136} // namespace ModulePW
137#endif //MODULE_PW_MULTI_DEVICE_H
Definition pw_op.cpp:3
Definition device.cpp:21
Definition pw_op.h:10
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.