Skip to content

Commit cd309f0

Browse files
committed
Add more tests with different input values to cover corner cases in computation SYCL kernel
1 parent d79022b commit cd309f0

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

dpnp/tests/test_binary_two_outputs_ufuncs.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,3 +335,25 @@ def test_special_int(self, dt):
335335
exp1, exp2 = numpy.divmod(a, b)
336336
assert_array_equal(res1, exp1)
337337
assert_array_equal(res2, exp2)
338+
339+
@pytest.mark.filterwarnings("ignore::RuntimeWarning")
340+
@pytest.mark.parametrize("dt", get_float_dtypes())
341+
def test_float_zero(self, dt):
342+
a = numpy.array([1, 0, -2], dtype=dt)
343+
ia = dpnp.array(a)
344+
345+
res1, res2 = dpnp.divmod(ia, 0)
346+
exp1, exp2 = numpy.divmod(a, 0)
347+
assert_array_equal(res1, exp1)
348+
assert_array_equal(res2, exp2)
349+
350+
@pytest.mark.parametrize("dt", get_float_dtypes())
351+
def test_float_diff_signs(self, dt):
352+
a = numpy.arange(-3, 7, dtype=dt).reshape((10, 1))
353+
b = numpy.array([[2, -2, 3, -3]])
354+
ia, ib = dpnp.array(a), dpnp.array(b)
355+
356+
res1, res2 = dpnp.divmod(ia, ib)
357+
exp1, exp2 = numpy.divmod(a, b)
358+
assert_array_equal(res1, exp1)
359+
assert_array_equal(res2, exp2)

0 commit comments

Comments
 (0)