Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
factor common call out of logic in _asarray_from_numpy_ndarray
  • Loading branch information
ndgrigorian committed Apr 23, 2025
commit eafb644f1301fc6d28b714ae85078385fe3fdf9a
3 changes: 1 addition & 2 deletions dpctl/tensor/_ctors.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ def _asarray_from_numpy_ndarray(
if dtype is None:
# deduce device-representable output data type
dtype = _map_to_device_dtype(ary.dtype, copy_q)
_ensure_native_dtype_device_support(dtype, copy_q.sycl_device)
f_contig = ary.flags["F"]
c_contig = ary.flags["C"]
fc_contig = f_contig or c_contig
Expand All @@ -245,10 +246,8 @@ def _asarray_from_numpy_ndarray(
order = "C" if c_contig else "F"
if order == "K":
# new USM allocation
_ensure_native_dtype_device_support(dtype, copy_q.sycl_device)
res = _from_numpy_empty_like_orderK(ary, dtype, usm_type, copy_q)
else:
_ensure_native_dtype_device_support(dtype, copy_q.sycl_device)
res = dpt.usm_ndarray(
ary.shape,
dtype=dtype,
Expand Down