We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ef0ef47 commit d9c2744Copy full SHA for d9c2744
1 file changed
devito/operator/operator.py
@@ -1408,16 +1408,19 @@ def _visible_devices(self):
1408
# Environment variable not set
1409
continue
1410
1411
- return {}
1412
-
+ return None
+
1413
@cached_property
1414
def _physical_deviceid(self):
1415
if isinstance(self.platform, Device):
1416
# Get the physical device ID (as CUDA_VISIBLE_DEVICES may be set)
1417
rank = self.comm.Get_rank() if self.comm != MPI.COMM_NULL else 0
1418
1419
logical_deviceid = max(self.get('deviceid', 0), 0) + rank
1420
- return self._visible_devices.get(logical_deviceid, logical_deviceid)
+ if self._visible_devices is None:
1421
+ return logical_deviceid
1422
+ else:
1423
+ return self._visible_devices[logical_deviceid]
1424
else:
1425
return None
1426
0 commit comments