ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
ModulePW::FFT_CPU< FPTYPE > Class Template Reference

#include <fft_cpu.h>

Inheritance diagram for ModulePW::FFT_CPU< FPTYPE >:
Collaboration diagram for ModulePW::FFT_CPU< FPTYPE >:

Public Member Functions

 FFT_CPU ()
 
 FFT_CPU (const int fft_mode_in)
 
 ~FFT_CPU ()
 
void initfft (int nx_in, int ny_in, int nz_in, int lixy_in, int rixy_in, int ns_in, int nplane_in, int nproc_in, bool gamma_only_in, bool xprime_in=true) override
 Initialize the fft parameters.
 
 __attribute__ ((weak)) void setupFFT() override
 Initialize the fft parameters as virtual function.
 
 __attribute__ ((weak)) void cleanFFT() override
 Initialize the fft parameters as virtual function.
 
 __attribute__ ((weak)) void clear() override
 Initialize the fft parameters as virtual function.
 
 __attribute__ ((weak)) FPTYPE *get_rspace_data() const override
 Get the real space data the CPU FFT.
 
__attribute__((weak)) std __attribute__((weak)) std __attribute__((weak)) void fftxyfor(std __attribute__((weak)) void fftxybac(std __attribute__((weak)) void fftzfor(std __attribute__((weak)) void fftzbac(std __attribute__ ((weak)) void fftxyr2c(FPTYPE *in
 Forward FFT in x-y direction.
 
void setupFFT ()
 Setup the fft plan and data as pure virtual function.
 
void cleanFFT ()
 Clean the fft plan as pure virtual function.
 
void clear ()
 Clear the fft data as pure virtual function.
 
void fftxyfor (std::complex< double > *in, std::complex< double > *out) const
 
void fftxybac (std::complex< double > *in, std::complex< double > *out) const
 
void fftzfor (std::complex< double > *in, std::complex< double > *out) const
 
void fftzbac (std::complex< double > *in, std::complex< double > *out) const
 
void fftxyr2c (double *in, std::complex< double > *out) const
 
void fftxyc2r (std::complex< double > *in, double *out) const
 
double * get_rspace_data () const
 
std::complex< double > * get_auxr_data () const
 
std::complex< double > * get_auxg_data () const
 
void setupFFT ()
 Setup the fft plan and data as pure virtual function.
 
void cleanFFT ()
 Clean the fft plan as pure virtual function.
 
void clear ()
 Clear the fft data as pure virtual function.
 
void fftxyfor (std::complex< float > *in, std::complex< float > *out) const
 
void fftxybac (std::complex< float > *in, std::complex< float > *out) const
 
void fftzfor (std::complex< float > *in, std::complex< float > *out) const
 
void fftzbac (std::complex< float > *in, std::complex< float > *out) const
 
void fftxyr2c (float *in, std::complex< float > *out) const
 
void fftxyc2r (std::complex< float > *in, float *out) const
 
float * get_rspace_data () const
 
std::complex< float > * get_auxr_data () const
 
std::complex< float > * get_auxg_data () const
 
- Public Member Functions inherited from ModulePW::FFT_BASE< FPTYPE >
 FFT_BASE ()
 
virtual ~FFT_BASE ()
 
virtual void resource_handler (const int flag) const
 Allocate and destory the resoure in FFT running time, Now it only used in the DSP mode.
 

Public Attributes

__attribute__((weak)) std __attribute__((weak)) std __attribute__((weak)) void fftxyfor(std __attribute__((weak)) void fftxybac(std __attribute__((weak)) void fftzfor(std __attribute__((weak)) void fftzbac(std std::complex< FPTYPE > *out const override
 
- Public Attributes inherited from ModulePW::FFT_BASE< FPTYPE >
virtual int ny_in
 
virtual int int nz_in
 
virtual int int int lixy_in
 
virtual int int int int rixy_in
 
virtual int int int int int ns_in
 
virtual int int int int int int nplane_in
 
virtual int int int int int int int nproc_in
 
virtual int int int int int int int bool gamma_only_in
 
virtual int int int int int int int bool bool xprime_in = true)
 
virtual virtual __attribute__((weak)) std virtual __attribute__((weak)) std virtual __attribute__((weak)) std virtual __attribute__((weak)) void fftxyfor(std virtual __attribute__((weak)) void fftxybac(std virtual __attribute__((weak)) void fftzfor(std virtual __attribute__((weak)) void fftzbac(std std::complex< FPTYPE > *out const
 

Private Member Functions

void clearfft (fftw_plan &plan)
 
void clearfft (fftwf_plan &plan)
 
void clearfft (fftw_plan &plan)
 
void clearfft (fftwf_plan &plan)
 

Private Attributes

fftw_plan planzfor = NULL
 
fftw_plan planzbac = NULL
 
fftw_plan planxfor1 = NULL
 
fftw_plan planxbac1 = NULL
 
fftw_plan planxfor2 = NULL
 
fftw_plan planxbac2 = NULL
 
fftw_plan planyfor = NULL
 
fftw_plan planybac = NULL
 
fftw_plan planxr2c = NULL
 
fftw_plan planxc2r = NULL
 
fftw_plan planyr2c = NULL
 
fftw_plan planyc2r = NULL
 
fftwf_plan planfzfor = NULL
 
fftwf_plan planfzbac = NULL
 
fftwf_plan planfxfor1 = NULL
 
fftwf_plan planfxbac1 = NULL
 
fftwf_plan planfxfor2 = NULL
 
fftwf_plan planfxbac2 = NULL
 
fftwf_plan planfyfor = NULL
 
fftwf_plan planfybac = NULL
 
fftwf_plan planfxr2c = NULL
 
fftwf_plan planfxc2r = NULL
 
fftwf_plan planfyr2c = NULL
 
fftwf_plan planfyc2r = NULL
 
std::complex< float > * c_auxg = nullptr
 
std::complex< float > * c_auxr = nullptr
 
std::complex< double > * z_auxg = nullptr
 
std::complex< double > * z_auxr = nullptr
 
float * s_rspace = nullptr
 
double * d_rspace = nullptr
 
int fftnx =0
 
int fftny =0
 
int fftnxy =0
 
int nxy =0
 
int nplane =0
 
int ns =0
 
int nproc =1
 
int maxgrids = 0
 
bool gamma_only = false
 
int lixy =0
 lixy: the left edge of the pw ball in the y direction
 
int rixy =0
 rixy: the right edge of the pw ball in the x or y direction
 
bool xprime = true
 xprime: whether xprime is used,when do recip2real, x-fft will be done last and when doing real2recip, x-fft will be done first; false: y-fft For gamma_only, true: we use half x; false: we use half y
 
int fft_mode = 0
 fft_mode: fftw mode 0: estimate, 1: measure, 2: patient, 3: exhaustive
 

Additional Inherited Members

- Protected Attributes inherited from ModulePW::FFT_BASE< FPTYPE >
int nx = 0
 Forward FFT in 3D.
 
int ny = 0
 
int nz = 0
 

Constructor & Destructor Documentation

◆ FFT_CPU() [1/2]

template<typename FPTYPE >
template ModulePW::FFT_CPU< FPTYPE >::FFT_CPU ( )
inline

◆ FFT_CPU() [2/2]

template<typename FPTYPE >
ModulePW::FFT_CPU< FPTYPE >::FFT_CPU ( const int  fft_mode_in)
inline

◆ ~FFT_CPU()

template<typename FPTYPE >
template ModulePW::FFT_CPU< FPTYPE >::~FFT_CPU ( )
inline

Member Function Documentation

◆ __attribute__() [1/5]

template<typename FPTYPE >
ModulePW::FFT_CPU< FPTYPE >::__attribute__ ( (weak)  ) const
overridevirtual

Get the real space data the CPU FFT.

Returns
FPTYPE* the real space data.

the function will return the real space data, which is used in the CPU fft.Use the weak attribute to avoid defining float while without flag ENABLE_FLOAT_FFTW.

Reimplemented from ModulePW::FFT_BASE< FPTYPE >.

◆ __attribute__() [2/5]

template<typename FPTYPE >
ModulePW::FFT_CPU< FPTYPE >::__attribute__ ( (weak)  )
overridevirtual

Initialize the fft parameters as virtual function.

The function is used to initialize the fft parameters.

Reimplemented from ModulePW::FFT_BASE< FPTYPE >.

◆ __attribute__() [3/5]

template<typename FPTYPE >
ModulePW::FFT_CPU< FPTYPE >::__attribute__ ( (weak)  )
overridevirtual

Initialize the fft parameters as virtual function.

The function is used to initialize the fft parameters.

Reimplemented from ModulePW::FFT_BASE< FPTYPE >.

◆ __attribute__() [4/5]

template<typename FPTYPE >
__attribute__((weak)) std __attribute__((weak)) std __attribute__((weak)) void fftxyfor(std __attribute__((weak)) void fftxybac(std __attribute__((weak)) void fftzfor(std __attribute__((weak)) void fftzbac(std ModulePW::FFT_CPU< FPTYPE >::__attribute__ ( (weak)  )
virtual

Forward FFT in x-y direction.

Parameters
ininput data
outoutput data

The function details can be found in FFT_BASE, and the function interfaces can be found in FFT_BUNDLE.

Reimplemented from ModulePW::FFT_BASE< FPTYPE >.

◆ __attribute__() [5/5]

template<typename FPTYPE >
ModulePW::FFT_CPU< FPTYPE >::__attribute__ ( (weak)  )
overridevirtual

Initialize the fft parameters as virtual function.

The function is used to initialize the fft parameters.

Reimplemented from ModulePW::FFT_BASE< FPTYPE >.

◆ cleanFFT() [1/2]

void ModulePW::FFT_CPU< double >::cleanFFT ( )
virtual

Clean the fft plan as pure virtual function.

The function is set as pure virtual function.In order to override the function in the derived class.In the derived class, the function is used to clean the fft plan.

Implements ModulePW::FFT_BASE< FPTYPE >.

◆ cleanFFT() [2/2]

void ModulePW::FFT_CPU< float >::cleanFFT ( )
virtual

Clean the fft plan as pure virtual function.

The function is set as pure virtual function.In order to override the function in the derived class.In the derived class, the function is used to clean the fft plan.

Implements ModulePW::FFT_BASE< FPTYPE >.

◆ clear() [1/2]

void ModulePW::FFT_CPU< double >::clear ( )
virtual

Clear the fft data as pure virtual function.

The function is set as pure virtual function.In order to override the function in the derived class.In the derived class, the function is used to clear the fft data.

Implements ModulePW::FFT_BASE< FPTYPE >.

◆ clear() [2/2]

void ModulePW::FFT_CPU< float >::clear ( )
virtual

Clear the fft data as pure virtual function.

The function is set as pure virtual function.In order to override the function in the derived class.In the derived class, the function is used to clear the fft data.

Implements ModulePW::FFT_BASE< FPTYPE >.

◆ clearfft() [1/4]

void ModulePW::FFT_CPU< double >::clearfft ( fftw_plan &  plan)
private

◆ clearfft() [2/4]

template<typename FPTYPE >
void ModulePW::FFT_CPU< FPTYPE >::clearfft ( fftw_plan &  plan)
private

◆ clearfft() [3/4]

template<typename FPTYPE >
void ModulePW::FFT_CPU< FPTYPE >::clearfft ( fftwf_plan &  plan)
private

◆ clearfft() [4/4]

void ModulePW::FFT_CPU< float >::clearfft ( fftwf_plan &  plan)
private

◆ fftxybac() [1/2]

void ModulePW::FFT_CPU< double >::fftxybac ( std::complex< double > *  in,
std::complex< double > *  out 
) const

◆ fftxybac() [2/2]

void ModulePW::FFT_CPU< float >::fftxybac ( std::complex< float > *  in,
std::complex< float > *  out 
) const

◆ fftxyc2r() [1/2]

void ModulePW::FFT_CPU< double >::fftxyc2r ( std::complex< double > *  in,
double *  out 
) const

◆ fftxyc2r() [2/2]

void ModulePW::FFT_CPU< float >::fftxyc2r ( std::complex< float > *  in,
float *  out 
) const

◆ fftxyfor() [1/2]

void ModulePW::FFT_CPU< double >::fftxyfor ( std::complex< double > *  in,
std::complex< double > *  out 
) const

◆ fftxyfor() [2/2]

void ModulePW::FFT_CPU< float >::fftxyfor ( std::complex< float > *  in,
std::complex< float > *  out 
) const

◆ fftxyr2c() [1/2]

void ModulePW::FFT_CPU< double >::fftxyr2c ( double *  in,
std::complex< double > *  out 
) const

◆ fftxyr2c() [2/2]

void ModulePW::FFT_CPU< float >::fftxyr2c ( float *  in,
std::complex< float > *  out 
) const

◆ fftzbac() [1/2]

void ModulePW::FFT_CPU< double >::fftzbac ( std::complex< double > *  in,
std::complex< double > *  out 
) const

◆ fftzbac() [2/2]

void ModulePW::FFT_CPU< float >::fftzbac ( std::complex< float > *  in,
std::complex< float > *  out 
) const

◆ fftzfor() [1/2]

void ModulePW::FFT_CPU< double >::fftzfor ( std::complex< double > *  in,
std::complex< double > *  out 
) const

◆ fftzfor() [2/2]

void ModulePW::FFT_CPU< float >::fftzfor ( std::complex< float > *  in,
std::complex< float > *  out 
) const

◆ get_auxg_data() [1/2]

std::complex< double > * ModulePW::FFT_CPU< double >::get_auxg_data ( ) const

◆ get_auxg_data() [2/2]

std::complex< float > * ModulePW::FFT_CPU< float >::get_auxg_data ( ) const

◆ get_auxr_data() [1/2]

std::complex< double > * ModulePW::FFT_CPU< double >::get_auxr_data ( ) const

◆ get_auxr_data() [2/2]

std::complex< float > * ModulePW::FFT_CPU< float >::get_auxr_data ( ) const

◆ get_rspace_data() [1/2]

double * ModulePW::FFT_CPU< double >::get_rspace_data ( ) const

◆ get_rspace_data() [2/2]

float * ModulePW::FFT_CPU< float >::get_rspace_data ( ) const

◆ initfft()

template<typename FPTYPE >
void ModulePW::FFT_CPU< FPTYPE >::initfft ( int  nx_in,
int  ny_in,
int  nz_in,
int  lixy_in,
int  rixy_in,
int  ns_in,
int  nplane_in,
int  nproc_in,
bool  gamma_only_in,
bool  xprime_in = true 
)
override

Initialize the fft parameters.

Parameters
nx_innumber of grid points in x direction.
ny_innumber of grid points in y direction.
nz_innumber of grid points in z direction.
lixy_inthe position of the left boundary in the x-y plane.
rixy_inthe position of the right boundary in the x-y plane.
ns_innumber of stick whcih is used in the Z direction.
nplane_innumber of x-y planes.
nproc_innumber of processors.
gamma_only_inwhether only gamma point is used.
xprime_inwhether xprime is used.

◆ setupFFT() [1/2]

void ModulePW::FFT_CPU< double >::setupFFT ( )
virtual

Setup the fft plan and data as pure virtual function.

The function is set as pure virtual function.In order to override the function in the derived class.In the derived class, the function is used to setup the fft plan and data.

Implements ModulePW::FFT_BASE< FPTYPE >.

◆ setupFFT() [2/2]

void ModulePW::FFT_CPU< float >::setupFFT ( )
virtual

Setup the fft plan and data as pure virtual function.

The function is set as pure virtual function.In order to override the function in the derived class.In the derived class, the function is used to setup the fft plan and data.

Implements ModulePW::FFT_BASE< FPTYPE >.

Member Data Documentation

◆ c_auxg

template<typename FPTYPE >
std::complex<float>* ModulePW::FFT_CPU< FPTYPE >::c_auxg = nullptr
private

◆ c_auxr

template<typename FPTYPE >
std::complex<float>* ModulePW::FFT_CPU< FPTYPE >::c_auxr = nullptr
private

◆ d_rspace

template<typename FPTYPE >
double* ModulePW::FFT_CPU< FPTYPE >::d_rspace = nullptr
private

◆ fft_mode

template<typename FPTYPE >
int ModulePW::FFT_CPU< FPTYPE >::fft_mode = 0
private

fft_mode: fftw mode 0: estimate, 1: measure, 2: patient, 3: exhaustive

◆ fftnx

template<typename FPTYPE >
int ModulePW::FFT_CPU< FPTYPE >::fftnx =0
private

◆ fftnxy

template<typename FPTYPE >
int ModulePW::FFT_CPU< FPTYPE >::fftnxy =0
private

◆ fftny

template<typename FPTYPE >
int ModulePW::FFT_CPU< FPTYPE >::fftny =0
private

◆ gamma_only

template<typename FPTYPE >
bool ModulePW::FFT_CPU< FPTYPE >::gamma_only = false
private

◆ lixy

template<typename FPTYPE >
int ModulePW::FFT_CPU< FPTYPE >::lixy =0
private

lixy: the left edge of the pw ball in the y direction

◆ maxgrids

template<typename FPTYPE >
int ModulePW::FFT_CPU< FPTYPE >::maxgrids = 0
private

◆ nplane

template<typename FPTYPE >
int ModulePW::FFT_CPU< FPTYPE >::nplane =0
private

◆ nproc

template<typename FPTYPE >
int ModulePW::FFT_CPU< FPTYPE >::nproc =1
private

◆ ns

template<typename FPTYPE >
int ModulePW::FFT_CPU< FPTYPE >::ns =0
private

◆ nxy

template<typename FPTYPE >
int ModulePW::FFT_CPU< FPTYPE >::nxy =0
private

◆ override

template<typename FPTYPE >
__attribute__((weak)) std __attribute__((weak)) std __attribute__((weak)) void fftxyfor(std __attribute__((weak)) void fftxybac(std __attribute__((weak)) void fftzfor(std __attribute__((weak)) void fftzbac(std std::complex<FPTYPE>* out const ModulePW::FFT_CPU< FPTYPE >::override

◆ planfxbac1

template<typename FPTYPE >
fftwf_plan ModulePW::FFT_CPU< FPTYPE >::planfxbac1 = NULL
private

◆ planfxbac2

template<typename FPTYPE >
fftwf_plan ModulePW::FFT_CPU< FPTYPE >::planfxbac2 = NULL
private

◆ planfxc2r

template<typename FPTYPE >
fftwf_plan ModulePW::FFT_CPU< FPTYPE >::planfxc2r = NULL
private

◆ planfxfor1

template<typename FPTYPE >
fftwf_plan ModulePW::FFT_CPU< FPTYPE >::planfxfor1 = NULL
private

◆ planfxfor2

template<typename FPTYPE >
fftwf_plan ModulePW::FFT_CPU< FPTYPE >::planfxfor2 = NULL
private

◆ planfxr2c

template<typename FPTYPE >
fftwf_plan ModulePW::FFT_CPU< FPTYPE >::planfxr2c = NULL
private

◆ planfybac

template<typename FPTYPE >
fftwf_plan ModulePW::FFT_CPU< FPTYPE >::planfybac = NULL
private

◆ planfyc2r

template<typename FPTYPE >
fftwf_plan ModulePW::FFT_CPU< FPTYPE >::planfyc2r = NULL
private

◆ planfyfor

template<typename FPTYPE >
fftwf_plan ModulePW::FFT_CPU< FPTYPE >::planfyfor = NULL
private

◆ planfyr2c

template<typename FPTYPE >
fftwf_plan ModulePW::FFT_CPU< FPTYPE >::planfyr2c = NULL
private

◆ planfzbac

template<typename FPTYPE >
fftwf_plan ModulePW::FFT_CPU< FPTYPE >::planfzbac = NULL
private

◆ planfzfor

template<typename FPTYPE >
fftwf_plan ModulePW::FFT_CPU< FPTYPE >::planfzfor = NULL
private

◆ planxbac1

template<typename FPTYPE >
fftw_plan ModulePW::FFT_CPU< FPTYPE >::planxbac1 = NULL
private

◆ planxbac2

template<typename FPTYPE >
fftw_plan ModulePW::FFT_CPU< FPTYPE >::planxbac2 = NULL
private

◆ planxc2r

template<typename FPTYPE >
fftw_plan ModulePW::FFT_CPU< FPTYPE >::planxc2r = NULL
private

◆ planxfor1

template<typename FPTYPE >
fftw_plan ModulePW::FFT_CPU< FPTYPE >::planxfor1 = NULL
private

◆ planxfor2

template<typename FPTYPE >
fftw_plan ModulePW::FFT_CPU< FPTYPE >::planxfor2 = NULL
private

◆ planxr2c

template<typename FPTYPE >
fftw_plan ModulePW::FFT_CPU< FPTYPE >::planxr2c = NULL
private

◆ planybac

template<typename FPTYPE >
fftw_plan ModulePW::FFT_CPU< FPTYPE >::planybac = NULL
private

◆ planyc2r

template<typename FPTYPE >
fftw_plan ModulePW::FFT_CPU< FPTYPE >::planyc2r = NULL
private

◆ planyfor

template<typename FPTYPE >
fftw_plan ModulePW::FFT_CPU< FPTYPE >::planyfor = NULL
private

◆ planyr2c

template<typename FPTYPE >
fftw_plan ModulePW::FFT_CPU< FPTYPE >::planyr2c = NULL
private

◆ planzbac

template<typename FPTYPE >
fftw_plan ModulePW::FFT_CPU< FPTYPE >::planzbac = NULL
private

◆ planzfor

template<typename FPTYPE >
fftw_plan ModulePW::FFT_CPU< FPTYPE >::planzfor = NULL
private

◆ rixy

template<typename FPTYPE >
int ModulePW::FFT_CPU< FPTYPE >::rixy =0
private

rixy: the right edge of the pw ball in the x or y direction

◆ s_rspace

template<typename FPTYPE >
float* ModulePW::FFT_CPU< FPTYPE >::s_rspace = nullptr
private

◆ xprime

template<typename FPTYPE >
bool ModulePW::FFT_CPU< FPTYPE >::xprime = true
private

xprime: whether xprime is used,when do recip2real, x-fft will be done last and when doing real2recip, x-fft will be done first; false: y-fft For gamma_only, true: we use half x; false: we use half y

◆ z_auxg

template<typename FPTYPE >
std::complex<double>* ModulePW::FFT_CPU< FPTYPE >::z_auxg = nullptr
private

◆ z_auxr

template<typename FPTYPE >
std::complex<double>* ModulePW::FFT_CPU< FPTYPE >::z_auxr = nullptr
private

The documentation for this class was generated from the following files: