Skip to content

Commit 89adfbc

Browse files
committed
Allow pointer ordinal null sentinels
1 parent 47e952c commit 89adfbc

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎cuda_bindings/tests/test_cuda.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,9 @@ def test_pointer_get_attributes_device_ordinal():
380380
err, attrs = cuda.cuPointerGetAttributes(len(attributes), attributes, 0)
381381

382382
assert err == cuda.CUresult.CUDA_SUCCESS
383-
assert attrs == [cuda.CU_DEVICE_INVALID]
383+
# Drivers use either negative sentinel for a null pointer. Both ensure the
384+
# signed device ordinal is returned rather than an unsigned value.
385+
assert attrs[0] in (cuda.CU_DEVICE_CPU, cuda.CU_DEVICE_INVALID)
384386

385387

386388
@pytest.mark.skipif(not supportsManagedMemory(), reason="When new attributes were introduced")

0 commit comments

Comments
 (0)