We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 2c86ef6 + d859362 commit c610e9bCopy full SHA for c610e9b
1 file changed
dpctl/tests/test_usm_ndarray_ctor.py
@@ -825,8 +825,11 @@ def test_astype():
825
X[:] = np.full((5, 5), 7, dtype="i4")
826
Y = dpt.astype(X, "c8", order="C")
827
assert np.allclose(dpt.to_numpy(Y), np.full((5, 5), 7, dtype="c8"))
828
- Y = dpt.astype(X[::2, ::-1], "f2", order="K")
829
- assert np.allclose(dpt.to_numpy(Y), np.full(Y.shape, 7, dtype="f2"))
+ if Y.sycl_device.has_aspect_fp16:
+ Y = dpt.astype(X[::2, ::-1], "f2", order="K")
830
+ assert np.allclose(dpt.to_numpy(Y), np.full(Y.shape, 7, dtype="f2"))
831
+ Y = dpt.astype(X[::2, ::-1], "f4", order="K")
832
+ assert np.allclose(dpt.to_numpy(Y), np.full(Y.shape, 7, dtype="f4"))
833
Y = dpt.astype(X[::2, ::-1], "i4", order="K", copy=False)
834
assert Y.usm_data is X.usm_data
835
0 commit comments