Skip to content

Commit 96d3ba0

Browse files
authored
cuda.bindings: Add test_nvrtcGetLoweredName_failure (#499)
* PR #497 squash-merged * Bring back test_nvrtcGetLoweredName_failure() (it was originally under PR #497). * Add code for debugging * test_all_CUresult_codes(): max_code = int(max(cuda.CUresult)) as suggested by at-leofang * Change pytest options, mostly to disable output capturing (of both stdout and stderr) * Undo debugging changes in nvrtc.pyx.in * Revert "Change pytest options, mostly to disable output capturing (of both stdout and stderr)" This reverts commit b0464e7. * Skip new test if nvrtc version < 12.1
1 parent 82df864 commit 96d3ba0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

cuda_bindings/tests/test_nvrtc.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,13 @@ def test_nvrtcGetSupportedArchs():
2929
err, supportedArchs = nvrtc.nvrtcGetSupportedArchs()
3030
ASSERT_DRV(err)
3131
assert len(supportedArchs) != 0
32+
33+
34+
@pytest.mark.skipif(nvrtcVersionLessThan(12, 1), reason="Preempt Segmentation Fault (see #499)")
35+
def test_nvrtcGetLoweredName_failure():
36+
err, name = nvrtc.nvrtcGetLoweredName(None, b"I'm an elevated name!")
37+
assert err == nvrtc.nvrtcResult.NVRTC_ERROR_INVALID_PROGRAM
38+
assert name is None
39+
err, name = nvrtc.nvrtcGetLoweredName(0, b"I'm another elevated name!")
40+
assert err == nvrtc.nvrtcResult.NVRTC_ERROR_INVALID_PROGRAM
41+
assert name is None

0 commit comments

Comments
 (0)