Skip to content

Commit

Permalink
Merge pull request #370 from toxa81/develop
Browse files Browse the repository at this point in the history
minor simplification
  • Loading branch information
toxa81 authored May 13, 2019
2 parents 19dcb9c + a6aff48 commit b118821
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/SDDK/GPU/acc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,17 +180,14 @@ namespace acc {
/// Get the number of devices.
inline int num_devices()
{
static int count{-1};
#if defined(__CUDA) || defined(__ROCM)
static int count{-1};
if (count == -1) {
if (GPU_PREFIX(GetDeviceCount)(&count) != GPU_PREFIX(Success)) {
return 0;
} else {
return count;
count = 0;
}
} else {
return count;
}
return count;
#else
return 0;
#endif
Expand Down

0 comments on commit b118821

Please sign in to comment.