Skip to content

Commit f91742a

Browse files
committed
fix gpu +U
1 parent 9e312fe commit f91742a

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

source/source_pw/module_pwdft/operator_pw/onsite_proj_pw.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,6 @@ void OnsiteProj<OperatorPW<T, Device>>::cal_ps_delta_spin(const int npol, const
211211

212212
template<typename T, typename Device>
213213
void OnsiteProj<OperatorPW<T, Device>>::cal_ps_dftu(
214-
Plus_U &dftu, // mohan add 20251106
215214
const int npol,
216215
const int m) const
217216
{
@@ -252,7 +251,7 @@ void OnsiteProj<OperatorPW<T, Device>>::cal_ps_dftu(
252251
for(int iat=0;iat<this->ucell->nat;iat++)
253252
{
254253
const int it = this->ucell->iat2it[iat];
255-
const int target_l = dftu.orbital_corr[it];
254+
const int target_l = this->dftu->orbital_corr[it];
256255
orb_l_iat0[iat] = target_l;
257256
const int nproj = onsite_p->get_nh(iat);
258257
if(target_l == -1)
@@ -291,10 +290,10 @@ void OnsiteProj<OperatorPW<T, Device>>::cal_ps_dftu(
291290
syncmem_int_h2d_op()(this->ip_m, ip_m0.data(), onsite_p->get_tot_nproj());
292291
syncmem_int_h2d_op()(this->vu_begin_iat, vu_begin_iat0.data(), this->ucell->nat);
293292

294-
resmem_complex_op()(this->vu_device, dftu.get_size_eff_pot_pw());
293+
resmem_complex_op()(this->vu_device, dftu->get_size_eff_pot_pw());
295294
}
296295

297-
syncmem_complex_h2d_op()(this->vu_device, dftu.get_eff_pot_pw(0), dftu.get_size_eff_pot_pw());
296+
syncmem_complex_h2d_op()(this->vu_device, dftu->get_eff_pot_pw(0), dftu->get_size_eff_pot_pw());
298297

299298
hamilt::onsite_ps_op<Real, Device>()(
300299
this->ctx, // device context
@@ -380,7 +379,6 @@ void OnsiteProj<OperatorPW<std::complex<float>, base_device::DEVICE_CPU>>::cal_p
380379

381380
template<>
382381
void OnsiteProj<OperatorPW<std::complex<float>, base_device::DEVICE_CPU>>::cal_ps_dftu(
383-
Plus_U &dftu,
384382
const int npol,
385383
const int m) const
386384
{}
@@ -426,7 +424,7 @@ void OnsiteProj<OperatorPW<T, Device>>::act(
426424
ModuleBase::timer::tick("Operator", "OnsiteProjPW");
427425
this->update_becp(tmpsi_in, npol, nbands);
428426
this->cal_ps_delta_spin(npol, nbands);
429-
this->cal_ps_dftu(*this->dftu, npol, nbands);
427+
this->cal_ps_dftu(npol, nbands);
430428
this->add_onsite_proj(tmhpsi, npol, nbands);
431429
ModuleBase::timer::tick("Operator", "OnsiteProjPW");
432430
}

source/source_pw/module_pwdft/operator_pw/onsite_proj_pw.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ class OnsiteProj<OperatorPW<T, Device>> : public OperatorPW<T, Device>
5252
private:
5353
void cal_ps_delta_spin(const int npol, const int m) const;
5454

55-
// mohan add dftu 20251106
56-
void cal_ps_dftu(Plus_U &dftu, const int npol, const int m) const;
55+
void cal_ps_dftu(const int npol, const int m) const;
5756

5857
void update_becp(const T* psi_in, const int npol, const int m) const;
5958

0 commit comments

Comments
 (0)