@@ -337,79 +337,6 @@ void PW_Basis_K::recip_to_real(const base_device::DEVICE_CPU* /*dev*/,
337337 this ->recip2real (in, out, ik, add, factor);
338338 #endif
339339}
340- template <>
341- void PW_Basis_K::convolution (const base_device::DEVICE_CPU * ctx,
342- const int ik,
343- const int size,
344- const std::complex <float >* input,
345- const float * input1,
346- std::complex <float >* output,
347- const bool add,
348- const float factor) const
349- {
350- }
351-
352- template <>
353- void PW_Basis_K::convolution (const base_device::DEVICE_CPU * ctx,
354- const int ik,
355- const int size,
356- const std::complex <double >* input,
357- const double * input1,
358- std::complex <double >* output,
359- const bool add,
360- const double factor) const
361- {
362- ModuleBase::timer::tick (this ->classname , " convolution" );
363- assert (this ->gamma_only == false );
364- // ModuleBase::GlobalFunc::ZEROS(fft_bundle.get_auxg_data<double>(), this->nst * this->nz);
365- // memset the auxr of 0 in the auxr,here the len of the auxr is nxyz
366- auto * auxg = this ->fft_bundle .get_auxg_data <double >();
367- auto * auxr=this ->fft_bundle .get_auxr_data <double >();
368-
369- memset (auxg, 0 , this ->nst * this ->nz * 2 * 8 );
370- const int startig = ik * this ->npwk_max ;
371- const int npwk = this ->npwk [ik];
372-
373- // copy the mapping form the type of stick to the 3dfft
374- #ifdef _OPENMP
375- #pragma omp parallel for schedule(static, 4096 / sizeof(double))
376- #endif
377- for (int igl = 0 ; igl < npwk; ++igl)
378- {
379- auxg[this ->igl2isz_k [igl + startig]] = input[igl];
380- }
381-
382- // use 3d fft backward
383- this ->fft_bundle .fftzbac (auxg, auxg);
384-
385- this ->gathers_scatterp (auxg, auxr);
386-
387- this ->fft_bundle .fftxybac (auxr, auxr);
388-
389- #ifdef _OPENMP
390- #pragma omp parallel for simd schedule(static) aligned(auxr, input1: 64)
391- #endif
392- for (int ir = 0 ; ir < size; ir++)
393- {
394- auxr[ir] *= input1[ir];
395- }
396- // 3d fft
397- this ->fft_bundle .fftxyfor (auxr, auxr);
398-
399- this ->gatherp_scatters (auxr, auxg);
400-
401- this ->fft_bundle .fftzfor (auxg, auxg);
402- // copy the result from the auxr to the out ,while consider the add
403- double tmpfac = factor / double (this ->nxyz );
404- #ifdef _OPENMP
405- #pragma omp parallel for schedule(static, 4096 / sizeof(double))
406- #endif
407- for (int igl = 0 ; igl < npwk; ++igl)
408- {
409- output[igl] += tmpfac * auxg[this ->igl2isz_k [igl + startig]];
410- }
411- ModuleBase::timer::tick (this ->classname , " convolution" );
412- }
413340
414341#if (defined(__CUDA) || defined(__ROCM))
415342template <>
0 commit comments