cuda exception handler

This commit is contained in:
Vladimir Mandic
2024-06-09 11:15:31 -04:00
parent 8a541d21fa
commit 3341a34549
+5 -2
View File
@@ -18,8 +18,11 @@ def _join_rocm_home(*paths) -> str:
def is_zluda(device: DeviceLikeType):
device = torch.device(device)
return torch.cuda.get_device_name(device).endswith("[ZLUDA]")
try:
device = torch.device(device)
return torch.cuda.get_device_name(device).endswith("[ZLUDA]")
except Exception:
return False
def test(device: DeviceLikeType) -> Union[Exception, None]: