diff --git a/source/source_pw/module_pwdft/vnl_pw.cpp b/source/source_pw/module_pwdft/vnl_pw.cpp index cfbee7933f..f5603349f0 100644 --- a/source/source_pw/module_pwdft/vnl_pw.cpp +++ b/source/source_pw/module_pwdft/vnl_pw.cpp @@ -768,10 +768,13 @@ void pseudopot_cell_vnl::init_vnl(UnitCell& cell, const ModulePW::PW_Basis* rho_ castmem_d2s_h2d_op()(this->s_nhtol, this->nhtol.c, this->nhtol.nr * this->nhtol.nc); castmem_d2s_h2d_op()(this->s_nhtolm, this->nhtolm.c, this->nhtolm.nr * this->nhtolm.nc); castmem_d2s_h2d_op()(this->s_tab, this->tab.ptr, this->tab.getSize()); - castmem_d2s_h2d_op()(this->s_qq_nt, this->qq_nt.ptr, this->qq_nt.getSize()); - castmem_z2c_h2d_op()(this->c_qq_so, this->qq_so.ptr, this->qq_so.getSize()); + if (this->nhm > 0) + { + castmem_d2s_h2d_op()(this->s_qq_nt, this->qq_nt.ptr, this->qq_nt.getSize()); + castmem_z2c_h2d_op()(this->c_qq_so, this->qq_so.ptr, this->qq_so.getSize()); + } } - if (PARAM.globalv.has_double_data) + if (PARAM.globalv.has_double_data && this->nhm > 0) { syncmem_z2z_h2d_op()(this->z_qq_so, this->qq_so.ptr, this->qq_so.getSize()); } @@ -782,7 +785,10 @@ void pseudopot_cell_vnl::init_vnl(UnitCell& cell, const ModulePW::PW_Basis* rho_ syncmem_d2d_h2d_op()(this->d_nhtol, this->nhtol.c, this->nhtol.nr * this->nhtol.nc); syncmem_d2d_h2d_op()(this->d_nhtolm, this->nhtolm.c, this->nhtolm.nr * this->nhtolm.nc); syncmem_d2d_h2d_op()(this->d_tab, this->tab.ptr, this->tab.getSize()); - syncmem_d2d_h2d_op()(this->d_qq_nt, this->qq_nt.ptr, this->qq_nt.getSize()); + if (this->nhm > 0) + { + syncmem_d2d_h2d_op()(this->d_qq_nt, this->qq_nt.ptr, this->qq_nt.getSize()); + } } else { @@ -792,8 +798,11 @@ void pseudopot_cell_vnl::init_vnl(UnitCell& cell, const ModulePW::PW_Basis* rho_ castmem_d2s_h2h_op()(this->s_nhtol, this->nhtol.c, this->nhtol.nr * this->nhtol.nc); castmem_d2s_h2h_op()(this->s_nhtolm, this->nhtolm.c, this->nhtolm.nr * this->nhtolm.nc); castmem_d2s_h2h_op()(this->s_tab, this->tab.ptr, this->tab.getSize()); - castmem_d2s_h2h_op()(this->s_qq_nt, this->qq_nt.ptr, this->qq_nt.getSize()); - castmem_z2c_h2h_op()(this->c_qq_so, this->qq_so.ptr, this->qq_so.getSize()); + if (this->nhm > 0) + { + castmem_d2s_h2h_op()(this->s_qq_nt, this->qq_nt.ptr, this->qq_nt.getSize()); + castmem_z2c_h2h_op()(this->c_qq_so, this->qq_so.ptr, this->qq_so.getSize()); + } } // There's no need to synchronize double precision pointers while in a CPU environment. } diff --git a/tests/01_PW/CASES_GPU.txt b/tests/01_PW/CASES_GPU.txt index 6d7bb6c74b..b302e5e5b8 100644 --- a/tests/01_PW/CASES_GPU.txt +++ b/tests/01_PW/CASES_GPU.txt @@ -17,10 +17,10 @@ scf_out_elf 013_PW_ONCV_LDA 014_PW_UPF201_BLPS 015_PW_GTH -#016_PW_BLPS -#017_PW_LPS6 -#018_PW_LPS8 -#019_PW_Coulomb +016_PW_BLPS +017_PW_LPS6 +018_PW_LPS8 +019_PW_Coulomb 020_PW_kspace 021_PW_kspace3 022_PW_CG @@ -113,17 +113,17 @@ scf_out_elf #208_PW_CG_float 209_PW_DFTHALF 210_PW_kspace_shift -#801_PW_LT_sc -#802_PW_LT_fcc +801_PW_LT_sc +802_PW_LT_fcc #803_PW_LT_bcc -#804_PW_LT_hex -#805_PW_LT_trigonal -#806_PW_LT_st -#807_PW_LT_bct -#808_PW_LT_so -#809_PW_LT_baco -#810_PW_LT_fco -#811_PW_LT_bco -#812_PW_LT_sm -#813_PW_LT_bacm -#814_PW_LT_triclinic +804_PW_LT_hex +805_PW_LT_trigonal +806_PW_LT_st +807_PW_LT_bct +808_PW_LT_so +809_PW_LT_baco +810_PW_LT_fco +811_PW_LT_bco +812_PW_LT_sm +813_PW_LT_bacm +814_PW_LT_triclinic