Skip to content

Commit 74cd428

Browse files
Address remarks
1 parent f1052ec commit 74cd428

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

dpnp/tests/test_linalg.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
get_all_dtypes,
2222
get_float_complex_dtypes,
2323
get_integer_float_dtypes,
24-
get_intel_mkl_version,
2524
has_support_aspect64,
2625
is_cpu_device,
2726
is_cuda_device,
2827
numpy_version,
28+
requires_intel_mkl_version,
2929
)
3030
from .third_party.cupy import testing
3131

@@ -333,7 +333,13 @@ def test_nan(self, p):
333333
# while OneMKL returns nans
334334
if is_cuda_device() and p in [-dpnp.inf, -1, 1, dpnp.inf, "fro"]:
335335
pytest.skip("Different behavior on CUDA")
336-
elif p in [-dpnp.inf, -1, 1, dpnp.inf, "fro"]:
336+
elif requires_intel_mkl_version("2025.2") and p in [
337+
-dpnp.inf,
338+
-1,
339+
1,
340+
dpnp.inf,
341+
"fro",
342+
]:
337343
pytest.skip("SAT-7966")
338344
a = generate_random_numpy_array((2, 2, 2, 2))
339345
a[0, 0] = 0
@@ -1753,7 +1759,9 @@ def test_inv_singular_matrix(self, matrix):
17531759
assert_raises(dpnp.linalg.LinAlgError, dpnp.linalg.inv, a_dp)
17541760

17551761
# TODO: remove skipif when Intel MKL 2025.2 is released
1756-
@pytest.mark.skipif(get_intel_mkl_version() < "2025.2", reason="mkl<2025.2")
1762+
@pytest.mark.skipif(
1763+
not requires_intel_mkl_version("2025.2"), reason="mkl<2025.2"
1764+
)
17571765
def test_inv_singular_matrix_3D(self):
17581766
a_np = numpy.array(
17591767
[[[1, 2], [3, 4]], [[1, 2], [1, 2]], [[1, 3], [3, 1]]]
@@ -2776,9 +2784,10 @@ def test_slogdet_strides(self):
27762784
assert_allclose(logdet_result, logdet_expected)
27772785

27782786
# TODO: remove skipif when Intel MKL 2025.2 is released
2779-
# Skip running on cpu because dpnp uses _getrf_batch only on cpu.
2787+
# Skip running on CPU because dpnp uses _getrf_batch only on CPU
2788+
# for dpnp.linalg.det/slogdet.
27802789
@pytest.mark.skipif(
2781-
is_cpu_device() and get_intel_mkl_version() < "2025.2",
2790+
is_cpu_device() and not requires_intel_mkl_version("2025.2"),
27822791
reason="mkl<2025.2",
27832792
)
27842793
@pytest.mark.parametrize(

dpnp/tests/third_party/cupy/linalg_tests/test_solve.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
import dpnp as cupy
77
from dpnp.tests.helper import (
88
assert_dtype_allclose,
9-
get_intel_mkl_version,
109
has_support_aspect64,
10+
requires_intel_mkl_version,
1111
)
1212
from dpnp.tests.third_party.cupy import testing
1313
from dpnp.tests.third_party.cupy.testing import _condition
@@ -215,7 +215,9 @@ def test_inv(self, dtype):
215215
xp.linalg.inv(a)
216216

217217
# TODO: remove skipif when Intel MKL 2025.2 is released
218-
@pytest.mark.skipif(get_intel_mkl_version() < "2025.2", reason="mkl<2025.2")
218+
@pytest.mark.skipif(
219+
not requires_intel_mkl_version("2025.2"), reason="mkl<2025.2"
220+
)
219221
@testing.for_dtypes("ifdFD")
220222
def test_batched_inv(self, dtype):
221223
for xp in (numpy, cupy):

0 commit comments

Comments
 (0)