We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e6da513 + b6ff2df commit 5ce4f42Copy full SHA for 5ce4f42
dpctl/tensor/_copy_utils.py
@@ -46,7 +46,10 @@ def _has_memory_overlap(x1, x2):
46
def _copy_to_numpy(ary):
47
if not isinstance(ary, dpt.usm_ndarray):
48
raise TypeError
49
- h = ary.usm_data.copy_to_host().view(ary.dtype)
+ nb = ary.usm_data.nbytes
50
+ hh = dpm.MemoryUSMHost(nb, queue=ary.sycl_queue)
51
+ hh.copy_from_device(ary.usm_data)
52
+ h = np.ndarray(nb, dtype="u1", buffer=hh).view(ary.dtype)
53
itsz = ary.itemsize
54
strides_bytes = tuple(si * itsz for si in ary.strides)
55
offset = ary.__sycl_usm_array_interface__.get("offset", 0) * itsz
0 commit comments