Skip to content

Commit fd64f0d

Browse files
committed
fix process
1 parent 597d012 commit fd64f0d

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed

source/module_basis/module_pw/module_fft/fft_bundle.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,7 @@ void FFT_Bundle::initfft(int nx_in,
5757
}
5858
#endif
5959
}
60-
if (this->precision == "double" || this->precision == "mixing")
61-
{
6260
double_flag = true;
63-
}
6461
#if defined(__DSP)
6562
if (device == "dsp")
6663
{

source/module_basis/module_pw/pw_basis.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ PW_Basis::PW_Basis()
1515

1616
PW_Basis::PW_Basis(std::string device_, std::string precision_) : device(std::move(device_)), precision(std::move(precision_)) {
1717
classname="PW_Basis";
18-
this->fft_bundle.setfft("cpu",this->precision);
18+
#if (not defined(__ENABLE_FLOAT_FFTW) and (defined(__CUDA)))
19+
this->fft_bundle.setfft("cpu","double");
20+
#else
21+
this->fft_bundle.setfft("cpu",this->precision);
22+
#endif
1923
this->double_data_ = (this->precision == "double") || (this->precision == "mixing");
2024
this->float_data_ = (this->precision == "single") || (this->precision == "mixing");
2125
}

source/module_basis/module_pw/pw_transform.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ void PW_Basis::recip2real(const std::complex<FPTYPE>* in, FPTYPE* out, const boo
210210
#endif
211211
for (int i = 0; i < this->nst * this->nz; ++i)
212212
{
213-
fft_bundle.get_auxg_data<FPTYPE>()[i] = std::complex<double>(0, 0);
213+
fft_bundle.get_auxg_data<FPTYPE>()[i] = std::complex<FPTYPE>(0, 0);
214214
}
215215

216216
#ifdef _OPENMP

source/module_hamilt_pw/hamilt_pwdft/structure_factor.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ void Structure_Factor::setup_structure_factor(const UnitCell* Ucell, const Paral
6868
// std::ofstream ofs( outstr.c_str() ) ;
6969
bool usebspline;
7070
if(nbspline > 0) { usebspline = true;
71-
} else { usebspline = false;
72-
}
71+
} else { usebspline = false;}
7372

7473
if(usebspline)
7574
{
@@ -147,6 +146,7 @@ void Structure_Factor::setup_structure_factor(const UnitCell* Ucell, const Paral
147146
inat++;
148147
}
149148
}
149+
150150
if (device == "gpu") {
151151
if (PARAM.globalv.has_float_data) {
152152
resmem_cd_op()(this->c_eigts1, Ucell->nat * (2 * rho_basis->nx + 1));
@@ -164,7 +164,9 @@ void Structure_Factor::setup_structure_factor(const UnitCell* Ucell, const Paral
164164
syncmem_z2z_h2d_op()(this->z_eigts3, this->eigts3.c, Ucell->nat * (2 * rho_basis->nz + 1));
165165
}
166166
else {
167+
std::cout<<"the test is "<<std::endl;
167168
if (PARAM.globalv.has_float_data) {
169+
std::cout<<"here set the float data"<<std::endl;
168170
resmem_ch_op()(this->c_eigts1, Ucell->nat * (2 * rho_basis->nx + 1));
169171
resmem_ch_op()(this->c_eigts2, Ucell->nat * (2 * rho_basis->ny + 1));
170172
resmem_ch_op()(this->c_eigts3, Ucell->nat * (2 * rho_basis->nz + 1));

source/module_io/read_set_globalv.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ void ReadInput::set_globalv(const Input_para& inp, System_para& sys)
7272
bool float_cond = false;
7373
#endif
7474
sys.has_double_data = (inp.precision == "double") || (inp.precision == "mixing") || float_cond;
75-
sys.has_float_data = (inp.precision == "float") || (inp.precision == "mixing") || float_cond;
75+
sys.has_float_data = (inp.precision == "single") || (inp.precision == "mixing") || float_cond;
7676
}
7777

7878
/// @note Here para.inp has not been synchronized of all ranks.

0 commit comments

Comments
 (0)