Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
6 changes: 6 additions & 0 deletions source/module_hamilt_pw/hamilt_pwdft/VNL_in_pw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::complex<double>, base_device::DEVICE_CPU>()
(this->z_vkb, this->vkb.size, "Nonlocal<PW>::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.
}
Expand Down
14 changes: 12 additions & 2 deletions source/module_hamilt_pw/hamilt_pwdft/operator_pw/nonlocal_pw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,12 @@ void Nonlocal<OperatorPW<T, Device>>::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<T, Device>()
#else
gemm_op()
#endif
(
transa,
transb,
this->npw,
Expand Down Expand Up @@ -259,7 +264,12 @@ void Nonlocal<OperatorPW<T, Device>>::act(
int npm = nbands;
//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// denghui replace 2022-10-20
gemm_op()(
#ifdef __DSP
ModuleBase::gemm_op_mt<T, Device>()
#else
gemm_op()
#endif
(
transa,
transb,
nkb,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,13 @@ class Nonlocal<OperatorPW<T, Device>> : public OperatorPW<T, Device>
using gemm_op = ModuleBase::gemm_op<T, Device>;
using nonlocal_op = nonlocal_pw_op<Real, Device>;
using setmem_complex_op = base_device::memory::set_memory_op<T, Device>;
#ifdef __DSP
using resmem_complex_op = base_device::memory::resize_memory_op_mt<T, Device>;
using delmem_complex_op = base_device::memory::delete_memory_op_mt<T, Device>;
#else
using resmem_complex_op = base_device::memory::resize_memory_op<T, Device>;
using delmem_complex_op = base_device::memory::delete_memory_op<T, Device>;
#endif
using syncmem_complex_h2d_op = base_device::memory::synchronize_memory_op<T, Device, base_device::DEVICE_CPU>;

T one{1, 0};
Expand Down
7 changes: 6 additions & 1 deletion source/module_io/read_input_item_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 lcao basis,\nPlease use double precision for lcao basis.\n");
}
// cpu single precision is not supported while float_fftw lib is not available
if (para.inp.device == "cpu" && para.inp.precision == "single")
{
Expand Down
Loading