Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove w/a related to dpctl-issue-2030 #2403

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
9 changes: 5 additions & 4 deletions dpnp/dpnp_iface_mathematical.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ def around(x, /, decimals=0, out=None):
Parameters
----------
x : {dpnp.ndarray, usm_ndarray}
Input array, expected to have a real-valued data type.
Input array, expected to have a boolean or real-valued data type.
out : {None, dpnp.ndarray, usm_ndarray}, optional
Output array to populate.
Array must have the correct shape and the expected data type.
Expand Down Expand Up @@ -791,6 +791,7 @@ def clip(a, /, min=None, max=None, *, out=None, order="K", **kwargs):

conj = conjugate


_COPYSIGN_DOCSTRING = """
Composes a floating-point value with the magnitude of `x1_i` and the sign of
`x2_i` for each element of input arrays `x1` and `x2`.
Expand Down Expand Up @@ -1717,7 +1718,7 @@ def ediff1d(ary, to_end=None, to_begin=None):
Parameters
----------
x : {dpnp.ndarray, usm_ndarray}
Input array, expected to have a real-valued data type.
Input array, expected to have a boolean or real-valued data type.
out : {None, dpnp.ndarray, usm_ndarray}, optional
Output array to populate.
Array must have the correct shape and the expected data type.
Expand Down Expand Up @@ -1878,7 +1879,7 @@ def ediff1d(ary, to_end=None, to_begin=None):
Parameters
----------
x : {dpnp.ndarray, usm_ndarray}
Input array, expected to have a real-valued data type.
Input array, expected to have a boolean or real-valued data type.
out : {None, dpnp.ndarray, usm_ndarray}, optional
Output array to populate.
Array must have the correct shape and the expected data type.
Expand Down Expand Up @@ -4551,7 +4552,7 @@ def trapezoid(y, x=None, dx=1.0, axis=-1):
Parameters
----------
x : {dpnp.ndarray, usm_ndarray}
Input array, expected to have a real-valued data type.
Input array, expected to have a boolean or real-valued data type.
out : {None, dpnp.ndarray, usm_ndarray}, optional
Output array to populate.
Array must have the correct shape and the expected data type.
Expand Down
22 changes: 1 addition & 21 deletions dpnp/tests/test_mathematical.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
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 @@ -2178,25 +2177,11 @@ 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
and is_gpu_device()
):
# TODO: get rid of w/a when dpctl#2030 is fixed
pass
else:
assert_raises(ValueError, getattr(dpnp, func), ia, out=iout)
assert_raises(ValueError, getattr(dpnp, func), ia, out=iout)
else:
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 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)

expected = getattr(numpy, func)(a, out=out)
result = getattr(dpnp, func)(ia, out=iout)
assert result is iout
Expand All @@ -2222,11 +2207,6 @@ 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 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)

expected = getattr(numpy, func)(a, out=out)
result = getattr(dpnp, func)(ia, out=usm_out)
assert result.get_array() is usm_out
Expand Down
2 changes: 0 additions & 2 deletions dpnp/tests/test_umath.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,6 @@ def test_umaths(test_cases):
and is_gpu_device()
):
pytest.skip("dpctl-1652")
elif umath in ["ceil", "floor", "trunc"] and args[0].dtype == dpnp.bool:
pytest.skip("dpctl-2030")
elif (
umath == "tan"
and dpnp.issubdtype(args[0].dtype, dpnp.complexfloating)
Expand Down
Loading