Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cuda_core/cuda/core/_program.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 7 additions & 0 deletions cuda_core/docs/source/release/1.2.0-notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,13 @@ Fixes and enhancements
Windows, both ``ctypes.CFUNCTYPE`` and ``ctypes.WINFUNCTYPE`` are accepted.
(`#2439 <https://github.com/NVIDIA/cuda-python/issues/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 <https://github.com/NVIDIA/cuda-python/issues/2570>`__)

Deprecation Notices
-------------------

Expand Down
13 changes: 7 additions & 6 deletions cuda_core/tests/test_program.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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)
Expand Down
Loading