Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Mar 28, 2024
1 parent de14a32 commit 811ff3a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions source/api_cc/src/DeepPotPT.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@ void DeepPotPT::init(const std::string& model,
return;
}
int gpu_num = torch::cuda::device_count();
if(gpu_num > 0)
if (gpu_num > 0) {
gpu_id = gpu_rank % gpu_num;

Check warning on line 42 in source/api_cc/src/DeepPotPT.cc

View check run for this annotation

Codecov / codecov/patch

source/api_cc/src/DeepPotPT.cc#L42

Added line #L42 was not covered by tests
else
} else {
gpu_id = 0;
}
torch::Device device(torch::kCUDA, gpu_id);
gpu_enabled = torch::cuda::is_available();
if (!gpu_enabled) {
Expand Down

0 comments on commit 811ff3a

Please sign in to comment.