diff --git a/cuda_bindings_13/cuda/bindings/utils/_ptx_utils.py b/cuda_bindings_13/cuda/bindings/utils/_ptx_utils.py index 1395fdfd469..5e8908efdae 100644 --- a/cuda_bindings_13/cuda/bindings/utils/_ptx_utils.py +++ b/cuda_bindings_13/cuda/bindings/utils/_ptx_utils.py @@ -51,6 +51,7 @@ "9.1": (13, 1), "9.2": (13, 2), "9.3": (13, 3), + "9.4": (13, 4), } diff --git a/cuda_bindings_13/tests/test_utils.py b/cuda_bindings_13/tests/test_utils.py index 84f7ca7b722..84f3b7ac1d0 100644 --- a/cuda_bindings_13/tests/test_utils.py +++ b/cuda_bindings_13/tests/test_utils.py @@ -17,6 +17,7 @@ get_minimal_required_cuda_ver_from_ptx_ver, get_ptx_ver, ) +from cuda.bindings.utils._ptx_utils import _ptx_to_cuda have_cufile = importlib.util.find_spec("cuda.bindings.cufile") is not None @@ -72,6 +73,16 @@ def test_ptx_utils(kernel, actual_ptx_ver, min_cuda_ver): assert cuda_ver == min_cuda_ver +@pytest.mark.agent_authored(model="gpt-6") +def test_ptx_mapping_covers_bindings_cuda_version(): + """Keep the PTX table in sync with the CUDA release of the generated bindings.""" + cuda_version = (driver.CUDA_VERSION // 1000, (driver.CUDA_VERSION % 1000) // 10) + assert cuda_version in _ptx_to_cuda.values(), ( + f"No PTX ISA mapping for CUDA {cuda_version[0]}.{cuda_version[1]}. " + "Check the PTX ISA release history and update cuda_bindings_13/cuda/bindings/utils/_ptx_utils.py." + ) + + @pytest.mark.parametrize( "target", (