Skip to content
Open
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Also, that release drops support for Python 3.9, making Python 3.10 the minimum
* Unified `dpnp` public API exports by consolidating function exports in `__init__.py` and removing wildcard imports [#2665](https://github.com/IntelPython/dpnp/pull/2665) [#2666](https://github.com/IntelPython/dpnp/pull/2666)
* Updated tests to reflect the new scalar conversion rules for non-0D `usm_ndarray` [#2694](https://github.com/IntelPython/dpnp/pull/2694)
* Compile indexing extension with `-fno-sycl-id-queries-fit-in-int` to support huge arrays [#2721](https://github.com/IntelPython/dpnp/pull/2721)
* Updated `dpnp.fix` to reuse `dpnp.trunc` internally [#2722](https://github.com/IntelPython/dpnp/pull/2722)

### Deprecated

Expand Down
1 change: 0 additions & 1 deletion dpnp/backend/extensions/ufunc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ set(_elementwise_sources
${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/divmod.cpp
${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/erf_funcs.cpp
${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/fabs.cpp
${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/fix.cpp
${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/float_power.cpp
${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/fmax.cpp
${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/fmin.cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include "divmod.hpp"
#include "erf_funcs.hpp"
#include "fabs.hpp"
#include "fix.hpp"
#include "float_power.hpp"
#include "fmax.hpp"
#include "fmin.hpp"
Expand Down Expand Up @@ -67,7 +66,6 @@ void init_elementwise_functions(py::module_ m)
init_divmod(m);
init_erf_funcs(m);
init_fabs(m);
init_fix(m);
init_float_power(m);
init_fmax(m);
init_fmin(m);
Expand Down
131 changes: 0 additions & 131 deletions dpnp/backend/extensions/ufunc/elementwise_functions/fix.cpp

This file was deleted.

38 changes: 0 additions & 38 deletions dpnp/backend/extensions/ufunc/elementwise_functions/fix.hpp

This file was deleted.

52 changes: 0 additions & 52 deletions dpnp/backend/kernels/elementwise_functions/fix.hpp

This file was deleted.

50 changes: 0 additions & 50 deletions dpnp/dpnp_algo/dpnp_elementwise_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
"DPNPBinaryFunc",
"DPNPBinaryFuncOutKw",
"DPNPBinaryTwoOutputsFunc",
"DPNPFix",
"DPNPImag",
"DPNPReal",
"DPNPRound",
Expand Down Expand Up @@ -1188,55 +1187,6 @@ def __call__(self, x, /, deg=False, *, out=None, order="K"):
return res


class DPNPFix(DPNPUnaryFunc):
"""Class that implements dpnp.fix unary element-wise functions."""

def __init__(
self,
name,
result_type_resolver_fn,
unary_dp_impl_fn,
docs,
):
super().__init__(
name,
result_type_resolver_fn,
unary_dp_impl_fn,
docs,
)

def __call__(self, x, /, out=None, *, order="K"):
if not dpnp.is_supported_array_type(x):
pass # pass to raise error in main implementation
elif dpnp.issubdtype(x.dtype, dpnp.inexact):
pass # for inexact types, pass to calculate in the backend
elif not (
out is None
or isinstance(out, tuple)
or dpnp.is_supported_array_type(out)
):
pass # pass to raise error in main implementation
elif not (
out is None or isinstance(out, tuple) or out.dtype == x.dtype
):
# passing will raise an error but with incorrect needed dtype
raise ValueError(
f"Output array of type {x.dtype} is needed, got {out.dtype}"
)
else:
# for exact types, return the input
out = self._unpack_out_kw(out)
if out is None:
return dpnp.copy(x, order=order)

if isinstance(out, dpt.usm_ndarray):
out = dpnp_array._create_from_usm_ndarray(out)
out[...] = x
return out

return super().__call__(x, out=out, order=order)


class DPNPI0(DPNPUnaryFunc):
"""Class that implements dpnp.i0 unary element-wise functions."""

Expand Down
10 changes: 6 additions & 4 deletions dpnp/dpnp_iface_mathematical.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
DPNPBinaryFunc,
DPNPBinaryFuncOutKw,
DPNPBinaryTwoOutputsFunc,
DPNPFix,
DPNPImag,
DPNPReal,
DPNPRound,
Expand Down Expand Up @@ -1867,11 +1866,14 @@ def ediff1d(ary, to_end=None, to_begin=None):

"""

fix = DPNPFix(
# reuse trunc backend implementation for fix
fix = DPNPUnaryFunc(
"fix",
ufi._fix_result_type,
ufi._fix,
ti._trunc_result_type,
ti._trunc,
_FIX_DOCSTRING,
mkl_fn_to_call="_mkl_trunc_to_call",
mkl_impl_fn="_trunc",
)


Expand Down
Loading