@@ -46,7 +46,7 @@ Potential::~Potential()
4646 }
4747 this ->components .clear ();
4848 }
49- if (PARAM.inp .device == " gpu" ) {
49+ if (PARAM.inp .basis_type == " pw " && PARAM. inp . device == " gpu" ) {
5050 if (PARAM.inp .precision == " single" ) {
5151 delmem_sd_op ()(gpu_ctx, s_veff_smooth);
5252 delmem_sd_op ()(gpu_ctx, s_vofk_smooth);
@@ -129,7 +129,7 @@ void Potential::allocate()
129129 this ->vofk_smooth .create (PARAM.inp .nspin , nrxx_smooth);
130130 ModuleBase::Memory::record (" Pot::vofk_smooth" , sizeof (double ) * PARAM.inp .nspin * nrxx_smooth);
131131 }
132- if (PARAM.inp .device == " gpu" ) {
132+ if (PARAM.inp .basis_type == " pw " && PARAM. inp . device == " gpu" ) {
133133 if (PARAM.inp .precision == " single" ) {
134134 resmem_sd_op ()(gpu_ctx, s_veff_smooth, PARAM.inp .nspin * nrxx_smooth);
135135 resmem_sd_op ()(gpu_ctx, s_vofk_smooth, PARAM.inp .nspin * nrxx_smooth);
@@ -177,7 +177,7 @@ void Potential::update_from_charge(const Charge*const chg, const UnitCell*const
177177 }
178178#endif
179179
180- if (PARAM.inp .device == " gpu" ) {
180+ if (PARAM.inp .basis_type == " pw " && PARAM. inp . device == " gpu" ) {
181181 if (PARAM.inp .precision == " single" ) {
182182 castmem_d2s_h2d_op ()(gpu_ctx,
183183 cpu_ctx,
0 commit comments