Skip to content

Commit af302a5

Browse files
Merge pull request #1292 from IntelPython/test-floor-ceil-trunc-changes
Fixed failure of test_floor_ceil_trunc_errors, sped up usm_type test
2 parents 43e3870 + 5fabcbd commit af302a5

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

dpctl/tests/elementwise/test_floor_ceil_trunc.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def test_floor_ceil_trunc_usm_type(np_call, dpt_call, usm_type):
5757
q = get_queue_or_skip()
5858

5959
arg_dt = np.dtype("f4")
60-
input_shape = (2, 2, 2, 10)
60+
input_shape = (10, 10, 10, 10)
6161
X = dpt.empty(input_shape, dtype=arg_dt, usm_type=usm_type, sycl_queue=q)
6262
X[..., 0::2] = -0.4
6363
X[..., 1::2] = 0.7
@@ -67,8 +67,7 @@ def test_floor_ceil_trunc_usm_type(np_call, dpt_call, usm_type):
6767
assert Y.sycl_queue == X.sycl_queue
6868
assert Y.flags.c_contiguous
6969

70-
expected_Y = np.empty(input_shape, dtype=arg_dt)
71-
expected_Y = np_call(np.float32(X))
70+
expected_Y = np_call(dpt.asnumpy(X))
7271
tol = 8 * dpt.finfo(Y.dtype).resolution
7372
assert_allclose(dpt.asnumpy(Y), expected_Y, atol=tol, rtol=tol)
7473

@@ -125,12 +124,6 @@ def test_floor_ceil_trunc_errors(dpt_call):
125124
y,
126125
)
127126

128-
x = dpt.zeros(2)
129-
y = x
130-
assert_raises_regex(
131-
TypeError, "Input and output arrays have memory overlap", dpt_call, x, y
132-
)
133-
134127
x = dpt.zeros(2, dtype="float32")
135128
y = np.empty_like(x)
136129
assert_raises_regex(

0 commit comments

Comments
 (0)