Skip to content

Commit

Permalink
fix nspin=4 error
Browse files Browse the repository at this point in the history
  • Loading branch information
dzzz2001 committed Oct 22, 2024
1 parent 39c29d3 commit 8884ddd
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 8884ddd

Please sign in to comment.