Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/Makefile.Objects
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ VPATH=./src_global:\
./source_base/module_mixing:\
./source_md:\
./source_basis/module_pw:\
./source_basis/module_pw/module_fft:\
./source_base/module_fft:\
./source_esolver:\
./source_hsolver:\
./source_hsolver/kernels:\
Expand Down
3 changes: 2 additions & 1 deletion source/source_base/kernels/dsp/dsp_connector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,8 @@ void zgemm_mth_(const char* transa,
c,
*ldc,
cluster_id);

free_ht(alp);
free_ht(bet);
} // zgemm that needn't malloc_ht or free_ht

void cgemm_mth_(const char* transa,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define FFT_BASE_H

#include <complex>
namespace ModulePW
namespace ModuleBase
{
template <typename FPTYPE>
class FFT_BASE
Expand Down Expand Up @@ -160,5 +160,5 @@ template FFT_BASE<float>::FFT_BASE();
template FFT_BASE<double>::FFT_BASE();
template FFT_BASE<float>::~FFT_BASE();
template FFT_BASE<double>::~FFT_BASE();
} // namespace ModulePW
} // namespace ModuleBase
#endif // FFT_BASE_H
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ std::unique_ptr<FFT_BASE> make_unique(Args&&... args)
{
return std::unique_ptr<FFT_BASE>(new FFT_BASE(std::forward<Args>(args)...));
}
namespace ModulePW
namespace ModuleBase
{
FFT_Bundle::~FFT_Bundle()
{
Expand Down Expand Up @@ -296,4 +296,4 @@ std::complex<double>* FFT_Bundle::get_auxr_3d_data() const
{
return fft_double->get_auxr_3d_data();
}
} // namespace ModulePW
} // namespace ModuleBase
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "fft_cpu.h"

#include <memory>
namespace ModulePW
namespace ModuleBase
{
class FFT_Bundle
{
Expand Down Expand Up @@ -216,5 +216,5 @@ struct FFT_Guard
}
};

} // namespace ModulePW
} // namespace ModuleBase
#endif // FFT_H
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "fft_cpu.h"
#include "fftw3.h"
namespace ModulePW
namespace ModuleBase
{

template <typename FPTYPE>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include "fft_base.h"
#include "fftw3.h"
namespace ModulePW
namespace ModuleBase
{
template <typename FPTYPE>
class FFT_CPU : public FFT_BASE<FPTYPE>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "fft_cpu.h"

namespace ModulePW
namespace ModuleBase
{
template <>
void FFT_CPU<float>::setupFFT()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "source_base/module_device/memory_op.h"
#include "source_pw/module_pwdft/global.h"

namespace ModulePW
namespace ModuleBase
{
template <typename FPTYPE>
void FFT_CUDA<FPTYPE>::initfft(int nx_in, int ny_in, int nz_in)
Expand Down Expand Up @@ -111,4 +111,4 @@ template FFT_CUDA<float>::FFT_CUDA();
template FFT_CUDA<float>::~FFT_CUDA();
template FFT_CUDA<double>::FFT_CUDA();
template FFT_CUDA<double>::~FFT_CUDA();
} // namespace ModulePW
} // namespace ModuleBase
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "fft_base.h"
#include "cufft.h"
#include "cuda_runtime.h"
namespace ModulePW
namespace ModuleBase
{
template <typename FPTYPE>
class FFT_CUDA : public FFT_BASE<FPTYPE>
Expand Down Expand Up @@ -63,5 +63,5 @@ class FFT_CUDA : public FFT_BASE<FPTYPE>

};

} // namespace ModulePW
} // namespace ModuleBase
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <iostream>
#include <string.h>
#include <vector>
namespace ModulePW
namespace ModuleBase
{
template <>
void FFT_DSP<double>::initfft(int nx_in, int ny_in, int nz_in)
Expand Down Expand Up @@ -124,4 +124,4 @@ template FFT_DSP<float>::FFT_DSP();
template FFT_DSP<float>::~FFT_DSP();
template FFT_DSP<double>::FFT_DSP();
template FFT_DSP<double>::~FFT_DSP();
} // namespace ModulePW
} // namespace ModuleBase
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "mtfft.h"
#include "fftw3.h"

namespace ModulePW
namespace ModuleBase
{

template <typename FPTYPE>
Expand Down Expand Up @@ -84,5 +84,5 @@ class FFT_DSP : public FFT_BASE<FPTYPE>
std::complex<double>* z_auxr_3d = nullptr; // fft space

};
} // namespace ModulePW
} // namespace ModuleBase
#endif
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "fft_dsp.h"
namespace ModulePW
namespace ModuleBase
{

template<>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "fft_rocm.h"
#include "source_base/module_device/memory_op.h"
#include "source_pw/module_pwdft/global.h"
namespace ModulePW
namespace ModuleBase
{
template <typename FPTYPE>
void FFT_ROCM<FPTYPE>::initfft(int nx_in,
Expand Down Expand Up @@ -107,4 +107,4 @@ template FFT_ROCM<float>::FFT_ROCM();
template FFT_ROCM<float>::~FFT_ROCM();
template FFT_ROCM<double>::FFT_ROCM();
template FFT_ROCM<double>::~FFT_ROCM();
}// namespace ModulePW
}// namespace ModuleBase
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "fft_base.h"
#include <hipfft/hipfft.h>
#include <hip/hip_runtime.h>
namespace ModulePW
namespace ModuleBase
{
template <typename FPTYPE>
class FFT_ROCM : public FFT_BASE<FPTYPE>
Expand Down Expand Up @@ -59,5 +59,5 @@ class FFT_ROCM : public FFT_BASE<FPTYPE>
mutable std::complex<double>* z_auxr_3d = nullptr; // fft space

};
}// namespace ModulePW
}// namespace ModuleBase
#endif
14 changes: 7 additions & 7 deletions source/source_basis/module_pw/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
if (ENABLE_FLOAT_FFTW)
list (APPEND FFT_SRC
module_fft/fft_cpu_float.cpp
../../source_base/module_fft/fft_cpu_float.cpp
)
endif()
if (USE_CUDA)
list (APPEND FFT_SRC
module_fft/fft_cuda.cpp
../../source_base/module_fft/fft_cuda.cpp
)
endif()
if (USE_ROCM)
list (APPEND FFT_SRC
module_fft/fft_rocm.cpp
../../source_base/module_fft/fft_rocm.cpp
)
endif()
if (USE_DSP)
list (APPEND FFT_SRC
module_fft/fft_dsp.cpp
module_fft/fft_dsp_float.cpp
../../source_base/module_fft/fft_dsp.cpp
../../source_base/module_fft/fft_dsp_float.cpp
pw_transform_k_dsp.cpp)
endif()

Expand All @@ -32,8 +32,8 @@ list(APPEND objects
pw_transform.cpp
pw_transform_gpu.cpp
pw_transform_k.cpp
module_fft/fft_bundle.cpp
module_fft/fft_cpu.cpp
../../source_base/module_fft/fft_bundle.cpp
../../source_base/module_fft/fft_cpu.cpp
${FFT_SRC}
)

Expand Down
4 changes: 2 additions & 2 deletions source/source_basis/module_pw/pw_basis.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "source_base/matrix3.h"
#include "source_base/vector3.h"
#include <complex>
#include "module_fft/fft_bundle.h"
#include "source_base/module_fft/fft_bundle.h"
#include <cstring>
#ifdef __MPI
#include "mpi.h"
Expand Down Expand Up @@ -245,7 +245,7 @@ class PW_Basis
int nmaxgr = 0; // Gamma_only: max between npw and (nrxx+1)/2, others: max between npw and nrxx
// Thus std::complex<double>[nmaxgr] is able to contain either reciprocal or real data
// FFT ft;
FFT_Bundle fft_bundle;
ModuleBase::FFT_Bundle fft_bundle;
//The position of pointer in and out can be equal(in-place transform) or different(out-of-place transform).

template <typename FPTYPE>
Expand Down
2 changes: 1 addition & 1 deletion source/source_basis/module_pw/pw_transform.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "source_base/global_function.h"
#include "source_base/timer.h"
#include "source_basis/module_pw/kernels/pw_op.h"
#include "module_fft/fft_bundle.h"
#include "source_base/module_fft/fft_bundle.h"
#include "pw_basis.h"
#include "pw_gatherscatter.h"

Expand Down
4 changes: 2 additions & 2 deletions source/source_basis/module_pw/test_serial/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ remove_definitions(-D__MLALGO)
add_library(
planewave_serial
OBJECT
../module_fft/fft_bundle.cpp
../module_fft/fft_cpu.cpp
../../../source_base/module_fft/fft_bundle.cpp
../../../source_base/module_fft/fft_cpu.cpp
../pw_basis.cpp
../pw_basis_k.cpp
../pw_basis_sup.cpp
Expand Down
3 changes: 2 additions & 1 deletion source/source_estate/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ AddTest(
TARGET elecstate_base
LIBS parameter ${math_libs} base device
SOURCES elecstate_base_test.cpp ../elecstate.cpp ../elecstate_tools.cpp ../occupy.cpp ../../source_psi/psi.cpp
../../source_base/module_fft/fft_bundle.cpp ../../source_base/module_fft/fft_cpu.cpp
)

AddTest(
Expand Down Expand Up @@ -97,7 +98,7 @@ AddTest(
TARGET charge_extra
LIBS parameter ${math_libs} base device cell_info
SOURCES charge_extra_test.cpp ../module_charge/charge_extra.cpp ../../source_io/read_cube.cpp ../../source_io/write_cube.cpp
../../source_io/output.cpp
../../source_io/output.cpp ../../source_base/module_fft/fft_bundle.cpp ../../source_base/module_fft/fft_cpu.cpp
)

endif()
2 changes: 1 addition & 1 deletion source/source_estate/test/charge_extra_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "source_io/module_parameter/parameter.h"
#include "source_estate/module_charge/charge_extra.h"
#include "prepare_unitcell.h"
#include "source_base/module_fft/fft_bundle.h"
#undef private
#undef protected
// mock functions for UnitCell
Expand Down Expand Up @@ -66,7 +67,6 @@ PW_Basis::PW_Basis()
PW_Basis::~PW_Basis()
{
}
FFT_Bundle::~FFT_Bundle(){};
void PW_Basis::initgrids(const double lat0_in, const ModuleBase::Matrix3 latvec_in, const double gridecut)
{
}
Expand Down
2 changes: 1 addition & 1 deletion source/source_estate/test/elecstate_base_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "source_estate/elecstate_tools.h"
#include "source_estate/occupy.h"
#include "source_io/module_parameter/parameter.h"
#include "source_base/module_fft/fft_bundle.h"
#undef protected
#undef private

Expand Down Expand Up @@ -63,7 +64,6 @@ ModulePW::PW_Basis::~PW_Basis()
ModulePW::PW_Basis_Sup::~PW_Basis_Sup()
{
}
ModulePW::FFT_Bundle::~FFT_Bundle() {};
void ModulePW::PW_Basis::initgrids(double, ModuleBase::Matrix3, double)
{
}
Expand Down
12 changes: 6 additions & 6 deletions source/source_hamilt/module_xc/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ AddTest(
)

if (USE_CUDA)
list(APPEND FFT_SRC ../../../source_basis/module_pw/module_fft/fft_cuda.cpp)
list(APPEND FFT_SRC ../../../source_base/module_fft/fft_cuda.cpp)
endif()
if (USE_ROCM)
list(APPEND FFT_SRC ../../../source_basis/module_pw/module_fft/fft_rocm.cpp)
list(APPEND FFT_SRC ../../../source_base/module_fft/fft_rocm.cpp)
endif()
AddTest(
TARGET XCTest_GRADCORR
Expand All @@ -41,8 +41,8 @@ AddTest(
../../../source_base/libm/branred.cpp
../../../source_base/libm/sincos.cpp
../../../source_base/module_external/blas_connector_base.cpp ../../../source_base/module_external/blas_connector_vector.cpp ../../../source_base/module_external/blas_connector_matrix.cpp
../../../source_basis/module_pw/module_fft/fft_bundle.cpp
../../../source_basis/module_pw/module_fft/fft_cpu.cpp
../../../source_base/module_fft/fft_bundle.cpp
../../../source_base/module_fft/fft_cpu.cpp
${FFT_SRC}
)

Expand Down Expand Up @@ -79,7 +79,7 @@ AddTest(
../../../source_base/timer.cpp
../../../source_base/libm/branred.cpp
../../../source_base/libm/sincos.cpp
../../../source_basis/module_pw/module_fft/fft_bundle.cpp
../../../source_basis/module_pw/module_fft/fft_cpu.cpp
../../../source_base/module_fft/fft_bundle.cpp
../../../source_base/module_fft/fft_cpu.cpp
${FFT_SRC}
)
4 changes: 2 additions & 2 deletions source/source_hsolver/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,14 @@ if (ENABLE_MPI)
TARGET MODULE_HSOLVER_pw
LIBS parameter ${math_libs} psi device base container
SOURCES test_hsolver_pw.cpp ../hsolver_pw.cpp ../hsolver_lcaopw.cpp ../diago_bpcg.cpp ../diago_dav_subspace.cpp ../diag_const_nums.cpp ../diago_iter_assist.cpp ../para_linear_transform.cpp
../../source_estate/elecstate_tools.cpp ../../source_estate/occupy.cpp
../../source_estate/elecstate_tools.cpp ../../source_estate/occupy.cpp ../../source_base/module_fft/fft_bundle.cpp ../../source_base/module_fft/fft_cpu.cpp
)

AddTest(
TARGET MODULE_HSOLVER_sdft
LIBS parameter ${math_libs} psi device base container
SOURCES test_hsolver_sdft.cpp ../hsolver_pw_sdft.cpp ../hsolver_pw.cpp ../diago_bpcg.cpp ../diago_dav_subspace.cpp ../diag_const_nums.cpp ../diago_iter_assist.cpp ../para_linear_transform.cpp
../../source_estate/elecstate_tools.cpp ../../source_estate/occupy.cpp
../../source_estate/elecstate_tools.cpp ../../source_estate/occupy.cpp ../../source_base/module_fft/fft_bundle.cpp ../../source_base/module_fft/fft_cpu.cpp
)

if(ENABLE_LCAO)
Expand Down
1 change: 0 additions & 1 deletion source/source_hsolver/test/hsolver_pw_sup.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ namespace ModulePW {

PW_Basis::PW_Basis(){};
PW_Basis::~PW_Basis(){};
FFT_Bundle::~FFT_Bundle(){};
void PW_Basis::initgrids(
const double lat0_in, // unit length (unit in bohr)
const ModuleBase::Matrix3
Expand Down
Loading