Skip to content

Commit

Permalink
fix compilation error (#5061)
Browse files Browse the repository at this point in the history
  • Loading branch information
dzzz2001 authored Sep 6, 2024
1 parent cada33d commit 3781749
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
6 changes: 5 additions & 1 deletion source/module_hamilt_lcao/module_gint/gint_force_gpu.cu
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ void gint_fvl_gpu(const hamilt::HContainer<double>* dm,
const Grid_Technique& gridt,
const UnitCell& ucell)
{
int dev_id = base_device::information::set_device_by_rank();
#ifdef __MPI
const int dev_id = base_device::information::set_device_by_rank();
#else
const int dev_id = 0;
#endif
// checkCuda(cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync));

const int nbzp = gridt.nbzp;
Expand Down
6 changes: 5 additions & 1 deletion source/module_hamilt_lcao/module_gint/gint_rho_gpu.cu
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ void gint_rho_gpu(const hamilt::HContainer<double>* dm,
const UnitCell& ucell,
double* rho)
{
int dev_id = base_device::information::set_device_by_rank();
#ifdef __MPI
const int dev_id = base_device::information::set_device_by_rank();
#else
const int dev_id = 0;
#endif
// checkCuda(cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync));

const int nbzp = gridt.nbzp;
Expand Down
6 changes: 5 additions & 1 deletion source/module_hamilt_lcao/module_gint/gint_vl_gpu.cu
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ void gint_vl_gpu(hamilt::HContainer<double>* hRGint,
double* pvpR,
const bool is_gamma_only)
{
int dev_id = base_device::information::set_device_by_rank();
#ifdef __MPI
const int dev_id = base_device::information::set_device_by_rank();
#else
const int dev_id = 0;
#endif
// checkCuda(cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync));
const int nbzp = gridt.nbzp;
const int num_streams = gridt.nstreams;
Expand Down
2 changes: 0 additions & 2 deletions source/module_hamilt_lcao/module_gint/grid_technique.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -560,8 +560,6 @@ int Grid_Technique::find_offset(const int id1, const int id2, const int iat1, co

void Grid_Technique::init_gpu_gint_variables(const UnitCell& ucell,
const int num_stream) {

int dev_id = base_device::information::set_device_by_rank();
if (is_malloced) {
free_gpu_gint_variables(this->nat);
}
Expand Down

0 comments on commit 3781749

Please sign in to comment.