Skip to content

Commit 5a2bcf4

Browse files
use numpy buffer as intermediary in copy_via_host routine
1 parent e46f6ff commit 5a2bcf4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dpctl/_memory.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ cdef void copy_via_host(void *dest_ptr, SyclQueue dest_queue,
5151
This is useful when `src_ptr` and `dest_ptr` are bound to incompatible
5252
SYCL contexts.
5353
"""
54-
# could also use numpy.empty((nbytes,), dtype="|u1")
55-
cdef unsigned char[::1] host_buf = bytearray(nbytes)
54+
# could also have used bytearray(nbytes)
55+
cdef unsigned char[::1] host_buf = np.empty((nbytes,), dtype="|u1")
5656

5757
DPPLQueue_Memcpy(
5858
src_queue.get_queue_ref(),

0 commit comments

Comments
 (0)