File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -1380,6 +1380,30 @@ def test_to_device():
1380
1380
assert Y .sycl_device == dev
1381
1381
1382
1382
1383
+ def test_to_device_stream_validation ():
1384
+ try :
1385
+ X = dpt .usm_ndarray (1 , "f4" )
1386
+ except dpctl .SyclDeviceCreationError :
1387
+ pytest .skip ("No SYCL devices available" )
1388
+ # invalid type of stream keyword
1389
+ with pytest .raises (TypeError ):
1390
+ X .to_device (X .sycl_queue , stream = dict ())
1391
+ # stream is keyword-only arg
1392
+ with pytest .raises (TypeError ):
1393
+ X .to_device (X .sycl_queue , X .sycl_queue )
1394
+
1395
+
1396
+ def test_to_device_stream_use ():
1397
+ try :
1398
+ X = dpt .usm_ndarray (1 , "f4" )
1399
+ except dpctl .SyclDeviceCreationError :
1400
+ pytest .skip ("No SYCL devices available" )
1401
+ q1 = dpctl .SyclQueue (
1402
+ X .sycl_context , X .sycl_device , property = "enable_profiling"
1403
+ )
1404
+ X .to_device (q1 , stream = q1 )
1405
+
1406
+
1383
1407
def test_to_device_migration ():
1384
1408
q1 = get_queue_or_skip () # two distinct copies of default-constructed queue
1385
1409
q2 = get_queue_or_skip ()
You can’t perform that action at this time.
0 commit comments