Skip to content

Commit 886a447

Browse files
committed
Fixed issue in asarray_from_numpy for uint64 dtype. And changed call copy_to function
1 parent 2723947 commit 886a447

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

dpctl/tensor/_ctors.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,10 @@ def _asarray_from_usm_ndarray(
186186
order=order,
187187
buffer_ctor_kwargs={"queue": copy_q},
188188
)
189-
# FIXME: call copy_to when implemented
190-
res[(slice(None, None, None),) * res.ndim] = usm_ndary
189+
hev, _ = ti._copy_usm_ndarray_into_usm_ndarray(
190+
src=usm_ndary, dst=res, sycl_queue=copy_q
191+
)
192+
hev.wait()
191193
return res
192194

193195

@@ -207,7 +209,7 @@ def _asarray_from_numpy_ndarray(
207209
if dtype is None:
208210
ary_dtype = ary.dtype
209211
dtype = _get_dtype(dtype, copy_q, ref_type=ary_dtype)
210-
if dtype.itemsize > ary_dtype.itemsize:
212+
if dtype.itemsize > ary_dtype.itemsize or ary_dtype == np.uint64:
211213
dtype = ary_dtype
212214
f_contig = ary.flags["F"]
213215
c_contig = ary.flags["C"]
@@ -244,8 +246,10 @@ def _asarray_from_numpy_ndarray(
244246
order=order,
245247
buffer_ctor_kwargs={"queue": copy_q},
246248
)
247-
# FIXME: call copy_to when implemented
248-
res[(slice(None, None, None),) * res.ndim] = ary
249+
hev, _ = ti._copy_numpy_ndarray_into_usm_ndarray(
250+
src=ary, dst=res, sycl_queue=copy_q
251+
)
252+
hev.wait()
249253
return res
250254

251255

0 commit comments

Comments
 (0)