You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0b5d816
Browse filesBrowse the repository at this point in the historyBrowse files
fix(cuda.core): emit -numba-debug with a single dash for NVVM (NVIDIA#2639)
* fix(cuda.core): emit -numba-debug with a single dash for NVVM
ProgramOptions(numba_debug=True) always failed on the NVVM backend.
The option was emitted as --numba-debug, but libNVVM's parser accepts
only single-dashed options, so every such compile raised
NVVM_ERROR_INVALID_OPTION. NVRTC tolerates both spellings and was
unaffected. This was the only double-dashed option in the NVVM path,
which otherwise emits -arch=, -g and -ftz=1.
The defect hid itself: test_nvvm_program_numba_debug was gated on a
probe that asked libNVVM about the same wrong spelling, so the test
skipped everywhere and had never executed. Fixing the probe makes it
run, and it passes. Its skip reason also blamed CTK 13.2, which is not
the cause.
libNVVM from CUDA 12.x rejects both spellings, so the option remains
unavailable there; the release note says so.
ClosesNVIDIA#2570
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
* fix(cuda.core): reject double-dashed NVVM options at the source
Add a guard at the single exit point of _prepare_nvvm_options_impl that
raises if any option is double-dashed. libNVVM accepts only single-dashed
options, and every option on this path is generated from typed fields, so
a double dash can only mean a bug in cuda.core rather than bad user input.
Raising here names the offending option instead of leaving the user with
libNVVM's opaque NVVM_ERROR_INVALID_OPTION.
The guard is a separate cpdef helper so a test can exercise it directly;
an inline check would be unreachable and therefore unverifiable. A second
test sets every NVVM-supported field of ProgramOptions and asserts no
emitted option is double-dashed, so the invariant covers options added
later.
Verified by mutation: restoring --numba-debug turns three tests red, and
the compile test then fails with this guard's error rather than libNVVM's.
The NVRTC path keeps --numba-debug, which it accepts; the guard is scoped
to the NVVM emitter.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
---------
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
0 commit comments