Skip to content

Commit 4e558f3

Browse files
Added test that readonly out raises
1 parent 0334928 commit 4e558f3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

dpctl/tests/test_usm_ndarray_linalg.py

+10
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,16 @@ def test_matmul_out():
332332
assert np.allclose(ref, dpt.asnumpy(res))
333333

334334

335+
def test_matmul_readonly_out():
336+
get_queue_or_skip()
337+
m = dpt.ones((10, 10), dtype=dpt.int32)
338+
r = dpt.empty_like(m)
339+
r.flags["W"] = False
340+
341+
with pytest.raises(ValueError):
342+
dpt.matmul(m, m, out=r)
343+
344+
335345
def test_matmul_dtype():
336346
get_queue_or_skip()
337347

0 commit comments

Comments
 (0)