From f7de4764b068c730a8c2a3e7075fb82569244183 Mon Sep 17 00:00:00 2001 From: Critsium-xy Date: Fri, 10 Oct 2025 14:00:25 +0800 Subject: [PATCH 1/2] Initial Commit --- source/source_base/module_fft/fft_dsp.cpp | 1 + source/source_pw/module_pwdft/VSep_in_pw.cpp | 4 ++-- source/source_pw/module_pwdft/VSep_in_pw.h | 4 ++-- source/source_pw/module_pwdft/operator_pw/veff_pw.cpp | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/source/source_base/module_fft/fft_dsp.cpp b/source/source_base/module_fft/fft_dsp.cpp index 82ea934f5b..0350556be9 100644 --- a/source/source_base/module_fft/fft_dsp.cpp +++ b/source/source_base/module_fft/fft_dsp.cpp @@ -1,6 +1,7 @@ #include "fft_dsp.h" #include "source_base/global_variable.h" +#include "source_base/global_function.h" #include #include diff --git a/source/source_pw/module_pwdft/VSep_in_pw.cpp b/source/source_pw/module_pwdft/VSep_in_pw.cpp index 3badccbe13..ee49a839a0 100644 --- a/source/source_pw/module_pwdft/VSep_in_pw.cpp +++ b/source/source_pw/module_pwdft/VSep_in_pw.cpp @@ -46,9 +46,9 @@ double shell_cut(double r, double r_in, double r_out, double r_power) } } // namespace -VSep::VSep() noexcept = default; +VSep::VSep() = default; -VSep::~VSep() noexcept = default; +VSep::~VSep() = default; void VSep::init_vsep(const ModulePW::PW_Basis& rho_basis, const Sep_Cell& sep_cell) { diff --git a/source/source_pw/module_pwdft/VSep_in_pw.h b/source/source_pw/module_pwdft/VSep_in_pw.h index e2344d43af..2c05b26491 100644 --- a/source/source_pw/module_pwdft/VSep_in_pw.h +++ b/source/source_pw/module_pwdft/VSep_in_pw.h @@ -10,8 +10,8 @@ class VSep { public: - VSep() noexcept; - ~VSep() noexcept; + VSep(); + ~VSep(); void init_vsep(const ModulePW::PW_Basis& rho_basis, const Sep_Cell& sep_cell); void generate_vsep_r(const ModulePW::PW_Basis& rho_basis, const ModuleBase::ComplexMatrix& sf_in, const Sep_Cell& sep_cell); diff --git a/source/source_pw/module_pwdft/operator_pw/veff_pw.cpp b/source/source_pw/module_pwdft/operator_pw/veff_pw.cpp index e2813b3a9a..6406b9267a 100644 --- a/source/source_pw/module_pwdft/operator_pw/veff_pw.cpp +++ b/source/source_pw/module_pwdft/operator_pw/veff_pw.cpp @@ -58,7 +58,7 @@ void Veff>::act( #ifdef __DSP if (npol == 1) { - ModulePW::FFT_Guard guard(wfcpw->fft_bundle); + ModuleBase::FFT_Guard guard(wfcpw->fft_bundle); for (int ib = 0; ib < nbands; ib += npol) { wfcpw->convolution(this->ctx, From b3f57e1b19fb4e14a33dd38a6589652947249eb8 Mon Sep 17 00:00:00 2001 From: Critsium-xy Date: Fri, 10 Oct 2025 14:25:49 +0800 Subject: [PATCH 2/2] Optimize Compilation experience on DSP --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index c0c7b83bf8..166dd12d0a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -481,8 +481,12 @@ else() find_package(Lapack REQUIRED) include_directories(${FFTW3_INCLUDE_DIRS}) list(APPEND math_libs FFTW3::FFTW3 LAPACK::LAPACK BLAS::BLAS) +if(USE_DSP) + target_link_libraries(${ABACUS_BIN_NAME} ${SCALAPACK_LIBRARY_DIR}) +else() find_package(ScaLAPACK REQUIRED) list(APPEND math_libs ScaLAPACK::ScaLAPACK) +endif() if(USE_OPENMP) list(APPEND math_libs FFTW3::FFTW3_OMP) endif()