diff --git a/dpnp/tests/helper.py b/dpnp/tests/helper.py index 7bf6f156e9eb..5d8ce22c910e 100644 --- a/dpnp/tests/helper.py +++ b/dpnp/tests/helper.py @@ -26,6 +26,12 @@ def _assert_shape(a, b): assert a.shape == (), f"{a.shape} != ()" +def _get_dev_mask(device=None): + dev = dpctl.select_default_device() if device is None else device + dev_info = dpctl.utils.intel_device_info(dev) + return dev_info.get("device_id", 0) & 0xFF00 + + def assert_dtype_allclose( dpnp_arr, numpy_arr, @@ -434,6 +440,22 @@ def is_intel_numpy(): return all(dep["name"].startswith("mkl") for dep in [blas, lapack]) +def is_iris_xe(device=None): + """ + Return True if a test is running on Iris Xe GPU device, False otherwise. + """ + return _get_dev_mask(device) == 0x9A00 + + +def is_lts_driver(device=None): + """ + Return True if a test is running on a GPU device with LTS driver version, + False otherwise. + """ + dev = dpctl.select_default_device() if device is None else device + return dev.has_aspect_gpu and "1.3" in dev.driver_version + + def is_win_platform(): """ Return True if a test is running on Windows OS, False otherwise. diff --git a/dpnp/tests/test_arraycreation.py b/dpnp/tests/test_arraycreation.py index c801b769a7e2..336162582928 100644 --- a/dpnp/tests/test_arraycreation.py +++ b/dpnp/tests/test_arraycreation.py @@ -19,6 +19,9 @@ assert_dtype_allclose, get_all_dtypes, get_array, + is_iris_xe, + is_lts_driver, + is_win_platform, ) from .third_party.cupy import testing @@ -913,6 +916,14 @@ def test_geomspace_num0(): @pytest.mark.parametrize("num", [2, 4, 8, 3, 9, 27]) @pytest.mark.parametrize("endpoint", [True, False]) def test_logspace(dtype, num, endpoint): + if not is_win_platform() and is_iris_xe() and is_lts_driver(): + if ( + dpnp.issubdtype(dtype, dpnp.integer) + and num in [8, 27] + and endpoint is True + ): + pytest.skip("SAT-7978") + start = 2 stop = 5 base = 2