Skip to content

Commit

Permalink
Reinstated the code that ensured cudaGetDeviceProperties is not repea…
Browse files Browse the repository at this point in the history
…tedly called.

Signed-off-by: Marat Arsaev <marsaev@nvidia.com>
  • Loading branch information
mattmartineau authored and marsaev committed Apr 7, 2020
1 parent cb986b3 commit 83629fe
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions base/src/device_properties.cu
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@
namespace amgx
{
static cudaDeviceProp deviceProps;
//static bool initialized=false;
static bool initialized=false;

cudaDeviceProp getDeviceProperties()
{
//if(!initialized) {
int dev;
cudaGetDevice(&dev);
cudaGetDeviceProperties(&deviceProps, dev);
//initialized=true;
//}
if(!initialized) {
int dev;
cudaGetDevice(&dev);
cudaGetDeviceProperties(&deviceProps, dev);
initialized=true;
}
return deviceProps;
}

Expand Down

0 comments on commit 83629fe

Please sign in to comment.