Skip to content

Commit

Permalink
Fix test_external_stream_create with NVIDIA bindings
Browse files Browse the repository at this point in the history
The underlying value of a handle is accessed differently with the NVIDIA
bindings.
  • Loading branch information
gmarkall committed Dec 4, 2024
1 parent 074c0b9 commit 3873f15
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions numba_cuda/numba/cuda/tests/cudapy/test_stream_api.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from numba.cuda.testing import (skip_on_cudasim, skip_unless_cudasim, unittest,
CUDATestCase)
from numba import cuda
from numba import config, cuda

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

@skip_unless_cudasim("External streams are usable with hardware")
def test_external_stream_simulator_unavailable(self):
Expand Down

0 comments on commit 3873f15

Please sign in to comment.