@@ -153,6 +153,7 @@ def _asarray_from_usm_ndarray(
153
153
if order == "K" and fc_contig :
154
154
order = "C" if c_contig else "F"
155
155
if order == "K" :
156
+ _ensure_native_dtype_device_support (dtype , copy_q .sycl_device )
156
157
# new USM allocation
157
158
res = dpt .usm_ndarray (
158
159
usm_ndary .shape ,
@@ -176,6 +177,7 @@ def _asarray_from_usm_ndarray(
176
177
strides = new_strides ,
177
178
)
178
179
else :
180
+ _ensure_native_dtype_device_support (dtype , copy_q .sycl_device )
179
181
res = dpt .usm_ndarray (
180
182
usm_ndary .shape ,
181
183
dtype = dtype ,
@@ -242,6 +244,7 @@ def _asarray_from_numpy_ndarray(
242
244
order = "C" if c_contig else "F"
243
245
if order == "K" :
244
246
# new USM allocation
247
+ _ensure_native_dtype_device_support (dtype , copy_q .sycl_device )
245
248
res = dpt .usm_ndarray (
246
249
ary .shape ,
247
250
dtype = dtype ,
@@ -261,6 +264,7 @@ def _asarray_from_numpy_ndarray(
261
264
res .shape , dtype = res .dtype , buffer = res .usm_data , strides = new_strides
262
265
)
263
266
else :
267
+ _ensure_native_dtype_device_support (dtype , copy_q .sycl_device )
264
268
res = dpt .usm_ndarray (
265
269
ary .shape ,
266
270
dtype = dtype ,
@@ -870,6 +874,7 @@ def empty_like(
870
874
sycl_queue = normalize_queue_device (sycl_queue = sycl_queue , device = device )
871
875
sh = x .shape
872
876
dtype = dpt .dtype (dtype )
877
+ _ensure_native_dtype_device_support (dtype , sycl_queue .sycl_device )
873
878
res = dpt .usm_ndarray (
874
879
sh ,
875
880
dtype = dtype ,
@@ -1202,6 +1207,7 @@ def eye(
1202
1207
dpctl .utils .validate_usm_type (usm_type , allow_none = False )
1203
1208
sycl_queue = normalize_queue_device (sycl_queue = sycl_queue , device = device )
1204
1209
dtype = _get_dtype (dtype , sycl_queue )
1210
+ _ensure_native_dtype_device_support (dtype , sycl_queue .sycl_device )
1205
1211
res = dpt .usm_ndarray (
1206
1212
(n_rows , n_cols ),
1207
1213
dtype = dtype ,
0 commit comments