Skip to content

Commit dee59ba

Browse files
committed
Exercise all other bindings changed in this PR. All of these would have segfaulted before.
1 parent dffc603 commit dee59ba

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

cuda_bindings/tests/test_cuda.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -977,3 +977,15 @@ def test_all_CUresult_codes(max_code=1000):
977977
# The number will increase over time as new enums are added and support for
978978
# old CTKs is dropped, but it is not critical that this number is updated.
979979
assert num_good >= 76 # CTK 11.0.3_450.51.06
980+
981+
982+
def test_cuKernelGetName_failure():
983+
err, name = cuda.cuKernelGetName(0)
984+
assert err == cuda.CUresult.CUDA_ERROR_INVALID_VALUE
985+
assert name is None
986+
987+
988+
def test_cuFuncGetName_failure():
989+
err, name = cuda.cuFuncGetName(0)
990+
assert err == cuda.CUresult.CUDA_ERROR_INVALID_VALUE
991+
assert name is None

cuda_bindings/tests/test_nvrtc.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,9 @@ def test_nvrtcGetSupportedArchs():
2929
err, supportedArchs = nvrtc.nvrtcGetSupportedArchs()
3030
ASSERT_DRV(err)
3131
assert len(supportedArchs) != 0
32+
33+
34+
def test_nvrtcGetLoweredName_failure():
35+
err, name = nvrtc.nvrtcGetLoweredName(0, b"I'm an elevated name!")
36+
assert err == nvrtc.nvrtcResult.NVRTC_ERROR_INVALID_PROGRAM
37+
assert name is None

0 commit comments

Comments
 (0)