Skip to content

Commit

Permalink
Completion of fix for gh-1058
Browse files Browse the repository at this point in the history
This changes builds up on gh-1265 and takes into account queue
from the pre-allocated buffer, if provided.
  • Loading branch information
oleksandr-pavlyk committed Aug 16, 2023
1 parent a75fff8 commit ff3c680
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dpctl/tensor/_usmarray.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,10 @@ cdef class usm_ndarray:
raise TypeError("Argument shape must be a list or a tuple.")
nd = len(shape)
if dtype is None:
q = buffer_ctor_kwargs.get("queue")
if isinstance(buffer, (dpmem._memory._Memory, usm_ndarray)):
q = buffer.sycl_queue
else:
q = buffer_ctor_kwargs.get("queue")
if q is not None:
dtype = default_device_fp_type(q)
else:
Expand Down

0 comments on commit ff3c680

Please sign in to comment.