File tree Expand file tree Collapse file tree 8 files changed +10
-52
lines changed
source/module_basis/module_pw Expand file tree Collapse file tree 8 files changed +10
-52
lines changed Original file line number Diff line number Diff line change 33namespace ModulePW
44{
55
6- template <>
7- void FFT_CPU<double >::initfft(int nx_in,
6+ template <typename FPTYPE >
7+ void FFT_CPU<FPTYPE >::initfft(int nx_in,
88 int ny_in,
99 int nz_in,
1010 int lixy_in,
@@ -457,8 +457,4 @@ template <> std::complex<double>*
457457FFT_CPU<double >::get_auxr_data() const {return z_auxr;}
458458template <> std::complex <double >*
459459FFT_CPU<double >::get_auxg_data() const {return z_auxg;}
460-
461-
462- template FFT_CPU<double >::FFT_CPU();
463- template FFT_CPU<double >::~FFT_CPU ();
464460}
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ class FFT_CPU : public FFT_BASE<FPTYPE>
3333 * @param gamma_only_in whether only gamma point is used.
3434 * @param xprime_in whether xprime is used.
3535 */
36- __attribute__ ((weak))
36+
3737 void initfft (int nx_in,
3838 int ny_in,
3939 int nz_in,
@@ -169,5 +169,7 @@ class FFT_CPU : public FFT_BASE<FPTYPE>
169169 */
170170 int fft_mode = 0 ;
171171};
172+ template FFT_CPU<float >::FFT_CPU();
173+ template FFT_CPU<double >::FFT_CPU();
172174}
173175#endif // FFT_CPU_H
Original file line number Diff line number Diff line change 33namespace ModulePW
44{
55template <>
6- void FFT_CPU<float >::initfft(int nx_in,
7- int ny_in,
8- int nz_in,
9- int lixy_in,
10- int rixy_in,
11- int ns_in,
12- int nplane_in,
13- int nproc_in,
14- bool gamma_only_in,
15- bool xprime_in)
16- {
17- this ->gamma_only = gamma_only_in;
18- this ->xprime = xprime_in;
19- this ->fftnx = this ->nx = nx_in;
20- this ->fftny = this ->ny = ny_in;
21- if (this ->gamma_only )
22- {
23- if (xprime) {
24- this ->fftnx = int (this ->nx / 2 ) + 1 ;
25- } else {
26- this ->fftny = int (this ->ny / 2 ) + 1 ;
27- }
28- }
29- this ->nz = nz_in;
30- this ->ns = ns_in;
31- this ->lixy = lixy_in;
32- this ->rixy = rixy_in;
33- this ->nplane = nplane_in;
34- this ->nproc = nproc_in;
35- this ->nxy = this ->nx * this ->ny ;
36- this ->fftnxy = this ->fftnx * this ->fftny ;
37- const int nrxx = this ->nxy * this ->nplane ;
38- const int nsz = this ->nz * this ->ns ;
39- this ->maxgrids = (nsz > nrxx) ? nsz : nrxx;
40- }
41- template <>
426void FFT_CPU<float >::setupFFT()
437{
448 unsigned int flag = FFTW_ESTIMATE;
@@ -466,6 +430,4 @@ template <> std::complex<float>*
466430FFT_CPU<float >::get_auxr_data() const {return c_auxr;}
467431template <> std::complex <float >*
468432FFT_CPU<float >::get_auxg_data() const {return c_auxg;}
469- template FFT_CPU<float >::FFT_CPU();
470- template FFT_CPU<float >::~FFT_CPU ();
471433}
Original file line number Diff line number Diff line change @@ -105,7 +105,4 @@ template <> std::complex<float>*
105105FFT_CUDA<float >::get_auxr_3d_data() const {return this ->c_auxr_3d ;}
106106template <> std::complex <double >*
107107FFT_CUDA<double >::get_auxr_3d_data() const {return this ->z_auxr_3d ;}
108-
109- template FFT_CUDA<float >::FFT_CUDA();
110- template FFT_CUDA<double >::FFT_CUDA();
111108}// namespace ModulePW
Original file line number Diff line number Diff line change @@ -62,5 +62,7 @@ class FFT_CUDA : public FFT_BASE<FPTYPE>
6262 std::complex <double >* z_auxr_3d = nullptr ; // fft space
6363
6464};
65+ template FFT_CUDA<float >::FFT_CUDA();
66+ template FFT_CUDA<double >::FFT_CUDA();
6567} // namespace ModulePW
6668#endif
Original file line number Diff line number Diff line change @@ -103,7 +103,4 @@ template <> std::complex<float>*
103103FFT_RCOM<float >::get_auxr_3d_data() const {return this ->c_auxr_3d ;}
104104template <> std::complex <double >*
105105FFT_RCOM<double >::get_auxr_3d_data() const {return this ->z_auxr_3d ;}
106-
107- template FFT_RCOM<float >::FFT_RCOM();
108- template FFT_RCOM<double >::FFT_RCOM();
109106}// namespace ModulePW
Original file line number Diff line number Diff line change @@ -57,5 +57,7 @@ class FFT_ROCM : public FFT_BASE<FPTYPE>
5757 mutable std::complex <double >* z_auxr_3d = nullptr ; // fft space
5858
5959};
60+ template FFT_RCOM<float >::FFT_RCOM();
61+ template FFT_RCOM<double >::FFT_RCOM();
6062}// namespace ModulePW
6163#endif
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ GTEST_DIR = /home/qianrui/gnucompile/g_gtest
2727HONG = -D__NORMAL
2828INCLUDES = -I. -I../../../ -I../../../module_base/module_container
2929LIBS =
30- OPTS = -Ofast -march=native -std=c++11 -m64 ${INCLUDES}
30+ OPTS = -Ofast -march=native -std=c++11 -m64 ${INCLUDES} -w -g
3131OBJ_DIR = obj
3232LIBNAME = libpw.a
3333GEN = OFF
You can’t perform that action at this time.
0 commit comments