Skip to content

Commit 7626716

Browse files
committed
Fix test_external_stream_create with NVIDIA bindings
The underlying value of a handle is accessed differently with the NVIDIA bindings.
1 parent a9765f2 commit 7626716

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

numba_cuda/numba/cuda/tests/cudapy/test_stream_api.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from numba.cuda.testing import (skip_on_cudasim, skip_unless_cudasim, unittest,
22
CUDATestCase)
3-
from numba import cuda
3+
from numba import config, cuda
44

55
# Basic tests that stream APIs execute on the hardware and in the simulator.
66
#
@@ -34,7 +34,11 @@ def test_external_stream_create(self):
3434
# We don't test synchronization on the stream because it's not a real
3535
# stream - we used a dummy pointer for testing the API, so we just
3636
# ensure that the stream handle matches the external stream pointer.
37-
self.assertEqual(ptr, s.handle.value)
37+
if config.CUDA_USE_NVIDIA_BINDING:
38+
value = int(s.handle)
39+
else:
40+
value = s.handle.value
41+
self.assertEqual(ptr, value)
3842

3943
@skip_unless_cudasim("External streams are usable with hardware")
4044
def test_external_stream_simulator_unavailable(self):

0 commit comments

Comments
 (0)