Skip to content

Commit cdc3e96

Browse files
committed
change the logic of the fft_float allocate
1 parent 7051e38 commit cdc3e96

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

source/module_base/module_fft/fft_temp.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ void FFT_TEMP::initfft(int nx_in, int ny_in, int nz_in, int lixy_in, int rixy_in
6464
{
6565
fft_float = new FFT_CPU<float>();
6666
fft_double = new FFT_CPU<double>();
67+
#ifndef __ENABLE_FLOAT_FFTW
68+
float_define = false;
69+
#endif
6770
}
6871
if (device=="gpu")
6972
{
@@ -77,12 +80,7 @@ void FFT_TEMP::initfft(int nx_in, int ny_in, int nz_in, int lixy_in, int rixy_in
7780
}
7881
if (this->precision=="single")
7982
{
80-
float_flag = true;
81-
#if defined (__ENABLE_FLOAT_FFTW) || defined(__CUDA) || defined(__ROCM)
82-
float_define = true;
83-
#endif
84-
85-
float_flag = float_define & float_flag;
83+
float_flag = float_define;
8684
double_flag = true;
8785
}
8886
else if (this->precision=="double")

source/module_base/module_fft/fft_temp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class FFT_TEMP
5555
private:
5656
int fft_mode = 0; ///< fftw mode 0: estimate, 1: measure, 2: patient, 3: exhaustive
5757
bool float_flag=false;
58-
bool float_define=false;
58+
bool float_define=true;
5959
bool double_flag=false;
6060
FFT_BASE<float>* fft_float=nullptr;
6161
FFT_BASE<double>* fft_double=nullptr;

0 commit comments

Comments
 (0)