Skip to content

Commit

Permalink
fix nspin=4 error (#5319)
Browse files Browse the repository at this point in the history
  • Loading branch information
dzzz2001 authored Oct 22, 2024
1 parent 3eac0e2 commit 6632c0b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions source/module_hamilt_lcao/module_gint/gint_vl_gpu.cu
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ void gint_vl_gpu(hamilt::HContainer<double>* hRGint,
checkCuda(cudaStreamCreate(&streams[i]));
}

Cuda_Mem_Wrapper<double> grid_vlocal_g(hRGint->get_nnr(), 1, false);
const int nnrg = is_gamma_only ? hRGint->get_nnr() : gridt.nnrg;
Cuda_Mem_Wrapper<double> grid_vlocal_g(nnrg, 1, false);
grid_vlocal_g.memset_device_sync();

Cuda_Mem_Wrapper<double> dr_part(max_atom_per_z * 3, num_streams, true);
Expand Down Expand Up @@ -189,15 +190,15 @@ void gint_vl_gpu(hamilt::HContainer<double>* hRGint,
checkCuda(cudaMemcpy(
hRGint->get_wrapper(),
grid_vlocal_g.get_device_pointer(),
hRGint->get_nnr() * sizeof(double),
nnrg * sizeof(double),
cudaMemcpyDeviceToHost));
}
else
{
checkCuda(cudaMemcpy(
pvpR,
grid_vlocal_g.get_device_pointer(),
hRGint->get_nnr() * sizeof(double),
nnrg * sizeof(double),
cudaMemcpyDeviceToHost));
}
for (int i = 0; i < num_streams; i++)
Expand Down

0 comments on commit 6632c0b

Please sign in to comment.