Skip to content

Commit c28127d

Browse files
committed
add ci test
1 parent 6207b04 commit c28127d

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

test/test_driver.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -935,6 +935,29 @@ def test_register_host_memory(self):
935935
drv.memcpy_htod_async(gpu_ary, a_pin, stream)
936936
drv.Context.synchronize()
937937

938+
@mark_cuda_test
939+
def test_stream_priority_setting(self):
940+
if drv.get_version() < (4,):
941+
from py.test import skip
942+
943+
skip("register_host_memory only exists on CUDA 4.0 and later")
944+
945+
import sys
946+
947+
if sys.platform == "darwin":
948+
from py.test import skip
949+
950+
skip("register_host_memory is not supported on OS X")
951+
952+
a = drv.aligned_empty((2 ** 20,), np.float64)
953+
a_pin = drv.register_host_memory(a)
954+
955+
gpu_ary = drv.mem_alloc_like(a)
956+
min_priority, max_priority = drv.get_stream_priority_range()
957+
stream = drv.Stream(priority=np.random.choice(range(min_priority, max_priority)))
958+
drv.memcpy_htod_async(gpu_ary, a_pin, stream)
959+
drv.Context.synchronize()
960+
938961
@mark_cuda_test
939962
# https://github.com/inducer/pycuda/issues/45
940963
def test_recursive_launch(self):

0 commit comments

Comments
 (0)