Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions dpnp/tests/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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.
Expand Down
11 changes: 11 additions & 0 deletions dpnp/tests/test_arraycreation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
Loading