@@ -47,6 +47,7 @@ from dpctl._backend cimport ( # noqa: E211
47
47
DPCTLQueue_Delete,
48
48
DPCTLQueue_GetContext,
49
49
DPCTLQueue_Memcpy,
50
+ DPCTLQueue_MemcpyWithEvents,
50
51
DPCTLQueue_Memset,
51
52
DPCTLSyclContextRef,
52
53
DPCTLSyclDeviceRef,
@@ -100,6 +101,7 @@ cdef void copy_via_host(void *dest_ptr, SyclQueue dest_queue,
100
101
# could also have used bytearray(nbytes)
101
102
cdef unsigned char [::1 ] host_buf = np.empty((nbytes,), dtype = " |u1" )
102
103
cdef DPCTLSyclEventRef E1Ref = NULL
104
+ cdef DPCTLSyclEventRef * depEvs = [NULL ,]
103
105
cdef DPCTLSyclEventRef E2Ref = NULL
104
106
105
107
E1Ref = DPCTLQueue_Memcpy(
@@ -108,16 +110,17 @@ cdef void copy_via_host(void *dest_ptr, SyclQueue dest_queue,
108
110
src_ptr,
109
111
nbytes
110
112
)
111
- with nogil: DPCTLEvent_Wait(E1Ref)
112
-
113
- E2Ref = DPCTLQueue_Memcpy(
113
+ depEvs[0 ] = E1Ref
114
+ E2Ref = DPCTLQueue_MemcpyWithEvents(
114
115
dest_queue.get_queue_ref(),
115
116
dest_ptr,
116
117
< void * > & host_buf[0 ],
117
- nbytes
118
+ nbytes,
119
+ depEvs,
120
+ 1
118
121
)
119
- with nogil: DPCTLEvent_Wait(E2Ref)
120
122
DPCTLEvent_Delete(E1Ref)
123
+ with nogil: DPCTLEvent_Wait(E2Ref)
121
124
DPCTLEvent_Delete(E2Ref)
122
125
123
126
@@ -224,7 +227,6 @@ cdef class _Memory:
224
227
self .memory_ptr = other_buf.p
225
228
self .nbytes = other_buf.nbytes
226
229
self .queue = other_buf.queue
227
- # self.writable = other_buf.writable
228
230
self .refobj = other
229
231
else :
230
232
raise ValueError (
0 commit comments