diff --git a/cuda_core/cuda/core/_program.pyx b/cuda_core/cuda/core/_program.pyx index 7fb099b06d2..8cf8d1bb9e7 100644 --- a/cuda_core/cuda/core/_program.pyx +++ b/cuda_core/cuda/core/_program.pyx @@ -1233,7 +1233,7 @@ cdef inline object _prepare_nvvm_options_impl(object opts, bint as_bytes): if opts.debug is not None and opts.debug: options.append("-g") if opts.numba_debug: - options.append("--numba-debug") + options.append("-numba-debug") if opts.device_code_optimize is False: options.append("-opt=0") elif opts.device_code_optimize is True: diff --git a/cuda_core/docs/source/release/1.2.0-notes.rst b/cuda_core/docs/source/release/1.2.0-notes.rst index 120d2c2a253..1c706c68d07 100644 --- a/cuda_core/docs/source/release/1.2.0-notes.rst +++ b/cuda_core/docs/source/release/1.2.0-notes.rst @@ -73,6 +73,13 @@ Fixes and enhancements Windows, both ``ctypes.CFUNCTYPE`` and ``ctypes.WINFUNCTYPE`` are accepted. (`#2439 `__) +- ``ProgramOptions(numba_debug=True)`` now works on the NVVM backend. The + option was emitted as ``--numba-debug``, and libNVVM accepts only the + single-dashed ``-numba-debug``, so every such compilation failed with + ``NVVM_ERROR_INVALID_OPTION``. The NVRTC backend, which tolerates both + spellings, was unaffected. + (`#2570 `__) + Deprecation Notices ------------------- diff --git a/cuda_core/tests/test_program.py b/cuda_core/tests/test_program.py index 28465425c0e..c3c484ba413 100644 --- a/cuda_core/tests/test_program.py +++ b/cuda_core/tests/test_program.py @@ -93,12 +93,12 @@ def _check_nvvm_arch(arch: str) -> bool: def _check_nvvm_supports_numba_debug() -> bool: - """Check if the installed libNVVM recognizes --numba-debug (CTK 13.2+).""" + """Check if the installed libNVVM recognizes -numba-debug.""" if not _has_check_nvvm_compiler_options(): return False from cuda.bindings.utils import check_nvvm_compiler_options - return check_nvvm_compiler_options(["--numba-debug"]) + return check_nvvm_compiler_options(["-numba-debug"]) @pytest.fixture(scope="session") @@ -762,18 +762,19 @@ def test_program_options_as_bytes_nvvm_unsupported_option(): @nvvm_available def test_nvvm_program_options_as_bytes_numba_debug(): - """numba_debug must be plumbed through to libNVVM as --numba-debug - (see #1287).""" + """numba_debug must be plumbed through to libNVVM as -numba-debug + (see #1287). libNVVM rejects the double-dashed form of every option.""" options = ProgramOptions(arch="sm_80", debug=True, numba_debug=True) nvvm_bytes = options.as_bytes("nvvm") - assert b"--numba-debug" in nvvm_bytes + assert b"-numba-debug" in nvvm_bytes + assert b"--numba-debug" not in nvvm_bytes assert b"-g" in nvvm_bytes @nvvm_available @pytest.mark.skipif( not _check_nvvm_supports_numba_debug(), - reason="installed libNVVM does not recognize --numba-debug (needs CTK 13.2+)", + reason="installed libNVVM does not recognize -numba-debug", ) def test_nvvm_program_numba_debug(init_cuda, nvvm_ir): options = ProgramOptions(arch="sm_80", debug=True, numba_debug=True)