Skip to content

Commit 8e43c77

Browse files
Adding test for gh-1201
1 parent bd60be8 commit 8e43c77

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

dpctl/tests/test_usm_ndarray_ctor.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2059,3 +2059,16 @@ def test_byte_bounds():
20592059
y = x[::-1, ::2]
20602060
lo, hi = y._byte_bounds
20612061
assert hi - lo == (n0 * n1 - 1) * x.itemsize
2062+
2063+
2064+
def test_gh_1201():
2065+
n = 100
2066+
a = np.flipud(np.arange(n, dtype="i4"))
2067+
try:
2068+
b = dpt.asarray(a)
2069+
except dpctl.SyclDeviceCreationError:
2070+
pytest.skip("No SYCL devices available")
2071+
assert (dpt.asnumpy(b) == a).all()
2072+
c = dpt.flip(dpt.empty(a.shape, dtype=a.dtype))
2073+
c[:] = a
2074+
assert (dpt.asnumpy(c) == a).all()

0 commit comments

Comments
 (0)