File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -816,7 +816,7 @@ cdef class usm_ndarray:
816
816
return _take_multi_index(res, adv_ind, adv_ind_start_p)
817
817
818
818
819
- def to_device (self , target ):
819
+ def to_device (self , target , stream = None ):
820
820
""" to_device(target_device)
821
821
822
822
Transfers this array to specified target device.
@@ -856,6 +856,14 @@ cdef class usm_ndarray:
856
856
cdef c_dpctl.DPCTLSyclQueueRef QRef = NULL
857
857
cdef c_dpmem._Memory arr_buf
858
858
d = Device.create_device(target)
859
+
860
+ if (stream is None or type (stream) is not dpctl.SyclQueue or
861
+ stream == self .sycl_queue):
862
+ pass
863
+ else :
864
+ ev = self .sycl_queue.submit_barrier()
865
+ stream.submit_barrier(dependent_events = [ev])
866
+
859
867
if (d.sycl_context == self .sycl_context):
860
868
arr_buf = < c_dpmem._Memory> self .usm_data
861
869
QRef = (< c_dpctl.SyclQueue> d.sycl_queue).get_queue_ref()
You can’t perform that action at this time.
0 commit comments