Skip to content

Commit 1ce56ab

Browse files
committed
Add CFD tests
1 parent 9e46f28 commit 1ce56ab

File tree

2 files changed

+24
-6
lines changed

2 files changed

+24
-6
lines changed

dpnp/tests/test_sycl_queue.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1488,10 +1488,19 @@ def test_interp(device, left, right, period):
14881488
assert_sycl_queue_equal(result.sycl_queue, x.sycl_queue)
14891489

14901490

1491-
@pytest.mark.parametrize("func", ["erf", "erfc", "erfcx"])
1491+
@pytest.mark.parametrize(
1492+
"func, low, high",
1493+
[
1494+
("erf", -3, 3),
1495+
("erfc", -3, 3),
1496+
("erfcx", -3, 3),
1497+
("erfinv", -1, 1),
1498+
("erfcinv", 0, 2),
1499+
],
1500+
)
14921501
@pytest.mark.parametrize("device", valid_dev, ids=dev_ids)
1493-
def test_erf_funcs(func, device):
1494-
x = dpnp.linspace(-3, 3, num=5, device=device)
1502+
def test_erf_funcs(func, low, high, device):
1503+
x = dpnp.linspace(low, high, num=5, device=device)
14951504

14961505
result = getattr(dpnp.scipy.special, func)(x)
14971506
assert_sycl_queue_equal(result.sycl_queue, x.sycl_queue)

dpnp/tests/test_usm_type.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1296,10 +1296,19 @@ def test_choose(usm_type_x, usm_type_ind):
12961296
assert z.usm_type == du.get_coerced_usm_type([usm_type_x, usm_type_ind])
12971297

12981298

1299-
@pytest.mark.parametrize("func", ["erf", "erfc", "erfcx"])
1299+
@pytest.mark.parametrize(
1300+
"func, low, high",
1301+
[
1302+
("erf", -3, 3),
1303+
("erfc", -3, 3),
1304+
("erfcx", -3, 3),
1305+
("erfinv", -1, 1),
1306+
("erfcinv", 0, 2),
1307+
],
1308+
)
13001309
@pytest.mark.parametrize("usm_type", list_of_usm_types)
1301-
def test_erf_funcs(func, usm_type):
1302-
x = dpnp.linspace(-3, 3, num=5, usm_type=usm_type)
1310+
def test_erf_funcs(func, low, high, usm_type):
1311+
x = dpnp.linspace(low, high, num=5, usm_type=usm_type)
13031312
y = getattr(dpnp.scipy.special, func)(x)
13041313
assert x.usm_type == y.usm_type == usm_type
13051314

0 commit comments

Comments
 (0)