From 254563672299b48903818ce7acfcb5ffa31a99ed Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Wed, 2 Apr 2025 11:10:40 +0200 Subject: [PATCH] Disable w/a for dpctl-2030 on CPU device --- dpnp/tests/test_mathematical.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/dpnp/tests/test_mathematical.py b/dpnp/tests/test_mathematical.py index c416a55e579..d594a76df62 100644 --- a/dpnp/tests/test_mathematical.py +++ b/dpnp/tests/test_mathematical.py @@ -32,6 +32,7 @@ get_integer_float_dtypes, has_support_aspect16, has_support_aspect64, + is_gpu_device, numpy_version, ) from .third_party.cupy import testing @@ -2177,7 +2178,12 @@ def test_out(self, func, dt_in, dt_out): if dt_in != dt_out: if numpy.can_cast(dt_in, dt_out, casting="same_kind"): # NumPy allows "same_kind" casting, dpnp does not - if func != "fix" and dt_in == dpnp.bool and dt_out == dpnp.int8: + if ( + func != "fix" + and dt_in == dpnp.bool + and dt_out == dpnp.int8 + and is_gpu_device() + ): # TODO: get rid of w/a when dpctl#2030 is fixed pass else: @@ -2186,7 +2192,7 @@ def test_out(self, func, dt_in, dt_out): assert_raises(ValueError, getattr(dpnp, func), ia, out=iout) assert_raises(TypeError, getattr(numpy, func), a, out=out) else: - if func != "fix" and dt_in == dpnp.bool: + if func != "fix" and dt_in == dpnp.bool and is_gpu_device(): # TODO: get rid of w/a when dpctl#2030 is fixed out = out.astype(numpy.int8) iout = iout.astype(dpnp.int8) @@ -2216,7 +2222,7 @@ def test_out_usm_ndarray(self, func, dt): out = numpy.empty(a.shape, dtype=dt) ia, usm_out = dpnp.array(a), dpt.asarray(out) - if func != "fix" and dt == dpnp.bool: + if func != "fix" and dt == dpnp.bool and is_gpu_device(): # TODO: get rid of w/a when dpctl#2030 is fixed out = out.astype(numpy.int8) usm_out = dpt.asarray(usm_out, dtype=dpnp.int8)