88#if defined (__DSP)
99namespace ModulePW
1010{
11- template <typename FPTYPE >
12- void PW_Basis_K::real2recip_dsp (const std::complex <FPTYPE >* in,
13- std::complex <FPTYPE >* out,
11+ template <>
12+ void PW_Basis_K::real2recip_dsp (const std::complex <float >* in,
13+ std::complex <float >* out,
1414 const int ik,
1515 const bool add,
16- const FPTYPE factor) const
16+ const float factor) const
17+ {
18+
19+ }
20+ template <>
21+ void PW_Basis_K::recip2real_dsp (const std::complex <float >* in,
22+ std::complex <float >* out,
23+ const int ik,
24+ const bool add,
25+ const float factor) const
26+ {
27+
28+ }
29+ template <>
30+ void PW_Basis_K::real2recip_dsp (const std::complex <double >* in,
31+ std::complex <double >* out,
32+ const int ik,
33+ const bool add,
34+ const double factor) const
1735{
1836 const base_device::DEVICE_CPU* ctx;
1937 const base_device::DEVICE_GPU* gpux;
@@ -31,20 +49,20 @@ void PW_Basis_K::real2recip_dsp(const std::complex<FPTYPE>* in,
3149 auxr);
3250 this ->fft_bundle .resource_handler (0 );
3351 // copy the result from the auxr to the out ,while consider the add
34- set_real_to_recip_output_op<FPTYPE , base_device::DEVICE_CPU>()(npw_k,
52+ set_real_to_recip_output_op<double , base_device::DEVICE_CPU>()(npw_k,
3553 this ->nxyz ,
3654 add,
3755 factor,
3856 this ->ig2ixyz_k_cpu .data () + startig,
3957 auxr,
4058 out);
4159}
42- template <typename FPTYPE >
43- void PW_Basis_K::recip2real_dsp (const std::complex <FPTYPE >* in,
44- std::complex <FPTYPE >* out,
60+ template <>
61+ void PW_Basis_K::recip2real_dsp (const std::complex <double >* in,
62+ std::complex <double >* out,
4563 const int ik,
4664 const bool add,
47- const FPTYPE factor) const
65+ const double factor) const
4866{
4967 assert (this ->gamma_only == false );
5068 const base_device::DEVICE_CPU* ctx;
@@ -128,16 +146,16 @@ void PW_Basis_K::convolution(const base_device::DEVICE_CPU* ctx,
128146 ModuleBase::timer::tick (this ->classname , " convolution" );
129147}
130148
131- // template void PW_Basis_K::real2recip_dsp<float>(const std::complex<float>* in,
132- // std::complex<float>* out,
133- // const int ik,
134- // const bool add,
135- // const float factor) const; // in:(nplane,nx*ny) ; out(nz, ns)
136- // template void PW_Basis_K::recip2real_dsp<float>(const std::complex<float>* in,
137- // std::complex<float>* out,
138- // const int ik,
139- // const bool add,
140- // const float factor) const; // in:(nz, ns) ; out(nplane,nx*ny)
149+ template void PW_Basis_K::real2recip_dsp<float >(const std::complex <float >* in,
150+ std::complex <float >* out,
151+ const int ik,
152+ const bool add,
153+ const float factor) const ; // in:(nplane,nx*ny) ; out(nz, ns)
154+ template void PW_Basis_K::recip2real_dsp<float >(const std::complex <float >* in,
155+ std::complex <float >* out,
156+ const int ik,
157+ const bool add,
158+ const float factor) const ; // in:(nz, ns) ; out(nplane,nx*ny)
141159
142160template void PW_Basis_K::real2recip_dsp<double >(const std::complex <double >* in,
143161 std::complex <double >* out,
0 commit comments