Skip to content
Merged
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
12 changes: 9 additions & 3 deletions dpnp/tests/test_mathematical.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
Loading