diff --git a/source/module_hamilt_pw/hamilt_pwdft/VNL_in_pw.cpp b/source/module_hamilt_pw/hamilt_pwdft/VNL_in_pw.cpp index 4edbb11992..ee9b2bb659 100644 --- a/source/module_hamilt_pw/hamilt_pwdft/VNL_in_pw.cpp +++ b/source/module_hamilt_pw/hamilt_pwdft/VNL_in_pw.cpp @@ -271,7 +271,13 @@ void pseudopot_cell_vnl::init(const UnitCell& ucell, resmem_sh_op()(s_tab, this->tab.getSize()); resmem_ch_op()(c_vkb, nkb * npwx); } + #ifdef __DSP + base_device::memory::resize_memory_op_mt, base_device::DEVICE_CPU>() + (this->z_vkb, this->vkb.size, "Nonlocal::ps"); + memcpy(this->z_vkb,this->vkb.c,this->vkb.size*16); + #else this->z_vkb = this->vkb.c; + #endif this->d_tab = this->tab.ptr; // There's no need to delete double precision pointers while in a CPU environment. } diff --git a/source/module_hamilt_pw/hamilt_pwdft/operator_pw/nonlocal_pw.cpp b/source/module_hamilt_pw/hamilt_pwdft/operator_pw/nonlocal_pw.cpp index 03eba19e48..66e5f04927 100644 --- a/source/module_hamilt_pw/hamilt_pwdft/operator_pw/nonlocal_pw.cpp +++ b/source/module_hamilt_pw/hamilt_pwdft/operator_pw/nonlocal_pw.cpp @@ -185,7 +185,12 @@ void Nonlocal>::add_nonlocal_pp(T *hpsi_in, const T *becp, int npm = m; //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< // denghui replace 2022-10-20 - gemm_op()( + #ifdef __DSP + ModuleBase::gemm_op_mt() + #else + gemm_op() + #endif + ( transa, transb, this->npw, @@ -259,7 +264,12 @@ void Nonlocal>::act( int npm = nbands; //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< // denghui replace 2022-10-20 - gemm_op()( + #ifdef __DSP + ModuleBase::gemm_op_mt() + #else + gemm_op() + #endif + ( transa, transb, nkb, diff --git a/source/module_hamilt_pw/hamilt_pwdft/operator_pw/nonlocal_pw.h b/source/module_hamilt_pw/hamilt_pwdft/operator_pw/nonlocal_pw.h index 31a98d24c9..2ae106cb96 100644 --- a/source/module_hamilt_pw/hamilt_pwdft/operator_pw/nonlocal_pw.h +++ b/source/module_hamilt_pw/hamilt_pwdft/operator_pw/nonlocal_pw.h @@ -89,8 +89,13 @@ class Nonlocal> : public OperatorPW using gemm_op = ModuleBase::gemm_op; using nonlocal_op = nonlocal_pw_op; using setmem_complex_op = base_device::memory::set_memory_op; + #ifdef __DSP + using resmem_complex_op = base_device::memory::resize_memory_op_mt; + using delmem_complex_op = base_device::memory::delete_memory_op_mt; + #else using resmem_complex_op = base_device::memory::resize_memory_op; using delmem_complex_op = base_device::memory::delete_memory_op; + #endif using syncmem_complex_h2d_op = base_device::memory::synchronize_memory_op; T one{1, 0}; diff --git a/source/module_io/read_input_item_system.cpp b/source/module_io/read_input_item_system.cpp index 847d4b2e74..7000d71410 100644 --- a/source/module_io/read_input_item_system.cpp +++ b/source/module_io/read_input_item_system.cpp @@ -812,7 +812,12 @@ void ReadInput::item_system() const std::string warningstr = nofound_str(avail_list, "precision"); ModuleBase::WARNING_QUIT("ReadInput", warningstr); } - + if (para.inp.precision == "single" && para.inp.basis_type == "lcao") + { + ModuleBase::WARNING_QUIT( + "ReadInput", + "Single precision is not supported for NAO basis,\nPlease use double precision for NAO basis.\n"); + } // cpu single precision is not supported while float_fftw lib is not available if (para.inp.device == "cpu" && para.inp.precision == "single") {