Skip to content

Commit 51ad4ac

Browse files
committed
Address agent feedback NVIDIA#3
- Medium: [arch_check.py:84](/wrk/forked/pr2788/cuda_python_test_helpers/cuda_python_test_helpers/arch_check.py:84) converts the raw NVML architecture integer to DeviceArch while handling an expected unsupported call. An unknown future architecture raises ValueError instead of skipping. Restore cont7’s try/except and UNKNOWN(<id>) fallback.
1 parent 0dda534 commit 51ad4ac

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎cuda_python_test_helpers/cuda_python_test_helpers/arch_check.py‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,11 @@ def unsupported_before(device, expected_device_arch):
8080
try:
8181
yield
8282
except (nvml.NotSupportedError, nvml.FunctionNotFoundError, NvmlSymbolNotFoundError):
83-
pytest.skip(
84-
f"Unsupported call for device architecture {nvml.DeviceArch(device_arch).name} "
85-
f"on device '{nvml.device_get_name(handle)}'"
86-
)
83+
try:
84+
name = nvml.DeviceArch(device_arch).name
85+
except ValueError:
86+
name = f"UNKNOWN({device_arch})"
87+
pytest.skip(f"Unsupported call for device architecture {name} on device '{nvml.device_get_name(handle)}'")
8788
elif int(device_arch) < expected_device_arch_int:
8889
# We know it will fail; assert that it does.
8990
with pytest.raises(nvml.NotSupportedError):

0 commit comments

Comments
 (0)