Skip to content

Commit ff3c680

Browse files
Completion of fix for gh-1058
This changes builds up on gh-1265 and takes into account queue from the pre-allocated buffer, if provided.
1 parent a75fff8 commit ff3c680

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

dpctl/tensor/_usmarray.pyx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,10 @@ cdef class usm_ndarray:
182182
raise TypeError("Argument shape must be a list or a tuple.")
183183
nd = len(shape)
184184
if dtype is None:
185-
q = buffer_ctor_kwargs.get("queue")
185+
if isinstance(buffer, (dpmem._memory._Memory, usm_ndarray)):
186+
q = buffer.sycl_queue
187+
else:
188+
q = buffer_ctor_kwargs.get("queue")
186189
if q is not None:
187190
dtype = default_device_fp_type(q)
188191
else:

0 commit comments

Comments
 (0)