From 5d0ea3c42fc709181f29de697f44b3d28c8fc699 Mon Sep 17 00:00:00 2001 From: Vladislav Perevezentsev Date: Wed, 11 Dec 2024 04:56:14 -0800 Subject: [PATCH] Skip TestCond::test_nan on CUDA --- dpnp/tests/test_linalg.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dpnp/tests/test_linalg.py b/dpnp/tests/test_linalg.py index 1911845d8ab..f03eae1ca5f 100644 --- a/dpnp/tests/test_linalg.py +++ b/dpnp/tests/test_linalg.py @@ -347,6 +347,12 @@ def test_bool(self, p): "p", [None, -dpnp.inf, -2, -1, 1, 2, dpnp.inf, "fro"] ) def test_nan(self, p): + # dpnp.linalg.cond uses dpnp.linalg.inv() + # for the case when p is not None or p != -2 or p != 2 + # For singular matrices cuSolver raises an error + # while OneMKL returns nans + if is_cuda_device() and p in [-dpnp.inf, -1, 1, dpnp.inf, "fro"]: + pytest.skip("Different behavior on CUDA") a = numpy.array(numpy.random.uniform(-5, 5, 16)).reshape(2, 2, 2, 2) a[0, 0] = 0 a[1, 1] = 0