Skip to content

Commit 434156d

Browse files
authored
Disable w/a for dpctl-2030 on CPU device (#2405)
The PR proposes to partly merge changes from #2403 to unblock coverage GitHub action. The workaround for dpctl-2030 was kept only for testing with GPU device (the use case from internal CI, where the changes from dpctl-2030 is not available).
1 parent d2da986 commit 434156d

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

dpnp/tests/test_mathematical.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
get_integer_float_dtypes,
3333
has_support_aspect16,
3434
has_support_aspect64,
35+
is_gpu_device,
3536
numpy_version,
3637
)
3738
from .third_party.cupy import testing
@@ -2177,7 +2178,12 @@ def test_out(self, func, dt_in, dt_out):
21772178
if dt_in != dt_out:
21782179
if numpy.can_cast(dt_in, dt_out, casting="same_kind"):
21792180
# NumPy allows "same_kind" casting, dpnp does not
2180-
if func != "fix" and dt_in == dpnp.bool and dt_out == dpnp.int8:
2181+
if (
2182+
func != "fix"
2183+
and dt_in == dpnp.bool
2184+
and dt_out == dpnp.int8
2185+
and is_gpu_device()
2186+
):
21812187
# TODO: get rid of w/a when dpctl#2030 is fixed
21822188
pass
21832189
else:
@@ -2186,7 +2192,7 @@ def test_out(self, func, dt_in, dt_out):
21862192
assert_raises(ValueError, getattr(dpnp, func), ia, out=iout)
21872193
assert_raises(TypeError, getattr(numpy, func), a, out=out)
21882194
else:
2189-
if func != "fix" and dt_in == dpnp.bool:
2195+
if func != "fix" and dt_in == dpnp.bool and is_gpu_device():
21902196
# TODO: get rid of w/a when dpctl#2030 is fixed
21912197
out = out.astype(numpy.int8)
21922198
iout = iout.astype(dpnp.int8)
@@ -2216,7 +2222,7 @@ def test_out_usm_ndarray(self, func, dt):
22162222
out = numpy.empty(a.shape, dtype=dt)
22172223
ia, usm_out = dpnp.array(a), dpt.asarray(out)
22182224

2219-
if func != "fix" and dt == dpnp.bool:
2225+
if func != "fix" and dt == dpnp.bool and is_gpu_device():
22202226
# TODO: get rid of w/a when dpctl#2030 is fixed
22212227
out = out.astype(numpy.int8)
22222228
usm_out = dpt.asarray(usm_out, dtype=dpnp.int8)

0 commit comments

Comments
 (0)