diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ea8d93..aece0d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Added mkl implementation for floating point data-types of `exp2`, `log2`, `fabs`, `copysign`, `nextafter`, `fmax`, `fmin` and `remainder` functions [gh-81](https://github.com/IntelPython/mkl_umath/pull/81) * Added mkl implementation for complex data-types of `conjugate` and `absolute` functions [gh-86](https://github.com/IntelPython/mkl_umath/pull/86) * Enabled support of Python 3.13 [gh-101](https://github.com/IntelPython/mkl_umath/pull/101) -* Added mkl implementation for complex data-types of `add`, `subtract`, `multiply` and `divide` functions [gh-88](https://github.com/IntelPython/mkl_umath/pull/88) +* Added mkl implementation for complex data-types of `add`, `subtract`, `multiply` and `divide` functions [gh-102](https://github.com/IntelPython/mkl_umath/pull/102) + +### Changed +* Dropped support for `maximum` and `minimum` [gh-104](https://github.com/IntelPython/mkl_umath/pull/104) ## [0.2.0] - 2025-06-03 This release updates `mkl_umath` to be aligned with both numpy-1.26.x and numpy-2.x.x. diff --git a/mkl_umath/generate_umath.py b/mkl_umath/generate_umath.py index 4633f48..f83b013 100644 --- a/mkl_umath/generate_umath.py +++ b/mkl_umath/generate_umath.py @@ -532,18 +532,8 @@ def english_upper(s): None, TD(inexactvec + cmplxvec, out='?'), ), -'maximum': - Ufunc(2, 1, ReorderableNone, - docstrings.get('numpy._core.umath.maximum'), - None, - TD(inexactvec + cmplxvec), - ), -'minimum': - Ufunc(2, 1, ReorderableNone, - docstrings.get('numpy._core.umath.minimum'), - None, - TD(inexactvec + cmplxvec), - ), +# 'maximum': +# 'minimum': # 'clip': 'fmax': Ufunc(2, 1, ReorderableNone, diff --git a/mkl_umath/src/mkl_umath_loops.c.src b/mkl_umath/src/mkl_umath_loops.c.src index aa4b927..1890dcd 100644 --- a/mkl_umath/src/mkl_umath_loops.c.src +++ b/mkl_umath/src/mkl_umath_loops.c.src @@ -1086,37 +1086,6 @@ mkl_umath_@TYPE@_@kind@(char **args, const npy_intp *dimensions, const npy_intp } /**end repeat1**/ -/**begin repeat1 - * #kind = maximum, minimum# - * #OP = >=, <=# - **/ -void -mkl_umath_@TYPE@_@kind@(char **args, const npy_intp *dimensions, const npy_intp *steps, void *NPY_UNUSED(func)) -{ - if (IS_BINARY_REDUCE) { - { - BINARY_REDUCE_LOOP(@type@) { - const @type@ in2 = *(@type@ *)ip2; - /* Order of operations important for MSVC 2015 */ - io1 = (io1 @OP@ in2 || isnan(io1)) ? io1 : in2; - } - *((@type@ *)iop1) = io1; - } - } - else { - BINARY_LOOP { - @type@ in1 = *(@type@ *)ip1; - const @type@ in2 = *(@type@ *)ip2; - /* Order of operations important for MSVC 2015 */ - in1 = (in1 @OP@ in2 || isnan(in1)) ? in1 : in2; - *((@type@ *)op1) = in1; - } - } - feclearexcept(FE_ALL_EXCEPT); /* clear floatstatus */ -} -/**end repeat1**/ - - void mkl_umath_@TYPE@_conjugate(char **args, const npy_intp *dimensions, const npy_intp *steps, void *NPY_UNUSED(func)) { @@ -1679,29 +1648,6 @@ mkl_umath_@TYPE@_sign(char **args, const npy_intp *dimensions, const npy_intp *s #endif } -/**begin repeat1 - * #kind = maximum, minimum# - * #OP = CGE, CLE# - */ -void -mkl_umath_@TYPE@_@kind@(char **args, const npy_intp *dimensions, const npy_intp *steps, void *NPY_UNUSED(func)) -{ - BINARY_LOOP { - @ftype@ in1r = ((@ftype@ *)ip1)[0]; - @ftype@ in1i = ((@ftype@ *)ip1)[1]; - const @ftype@ in2r = ((@ftype@ *)ip2)[0]; - const @ftype@ in2i = ((@ftype@ *)ip2)[1]; - if ( !(isnan(in1r) || isnan(in1i) || @OP@(in1r, in1i, in2r, in2i))) { - in1r = in2r; - in1i = in2i; - } - ((@ftype@ *)op1)[0] = in1r; - ((@ftype@ *)op1)[1] = in1i; - } - feclearexcept(FE_ALL_EXCEPT); /* clear floatstatus */ -} -/**end repeat1**/ - /**begin repeat1 * #kind = fmax, fmin# * #OP = CGE, CLE# diff --git a/mkl_umath/src/mkl_umath_loops.h.src b/mkl_umath/src/mkl_umath_loops.h.src index 286f301..a9f7d63 100644 --- a/mkl_umath/src/mkl_umath_loops.h.src +++ b/mkl_umath/src/mkl_umath_loops.h.src @@ -57,7 +57,7 @@ * # kind = absolute, add, arccos, arccosh, arcsin, arcsinh, arctan, arctanh, cbrt, ceil, conjugate, copysign, cos, cosh, divide, divmod, isfinite, isinf, isnan, equal, exp, exp2, expm1, fabs, floor, fmax, fmin, frexp, greater, greater_equal, ldexp, less, less_equal, log, log2, log10, - log1p, logical_and, logical_not, logical_or, logical_xor, maximum, minimum, multiply, modf, + log1p, logical_and, logical_not, logical_or, logical_xor, multiply, modf, negative, nextafter, not_equal, positive, reciprocal, remainder, rint, sign, signbit, sin, sinh, spacing, sqrt, square, subtract, tan, tanh, trunc# */ @@ -98,7 +98,7 @@ mkl_umath_@TYPE@_ldexp_long(char **args, const npy_intp *dimensions, const npy_i /**begin repeat1 * # kind = absolute, add, conjugate, divide, isfinite, isinf, isnan, equal, fmax, fmin, greater, greater_equal, - less, less_equal, logical_and, logical_not, logical_or, logical_xor, maximum, minimum, multiply, + less, less_equal, logical_and, logical_not, logical_or, logical_xor, multiply, not_equal, reciprocal, sign, square, subtract# */ MKL_UMATH_API diff --git a/mkl_umath/tests/test_basic.py b/mkl_umath/tests/test_basic.py index 9c2133f..9660662 100644 --- a/mkl_umath/tests/test_basic.py +++ b/mkl_umath/tests/test_basic.py @@ -142,7 +142,7 @@ def test_strided(func, dtype): assert np.allclose(mkl_res, np_res), f"Results for '{func}[strided]' do not match" -@pytest.mark.parametrize("func", ["add", "subtract", "multiply", "divide", "maximum", "minimum", "fmax", "fmin"]) +@pytest.mark.parametrize("func", ["add", "subtract", "multiply", "divide", "fmax", "fmin"]) @pytest.mark.parametrize("dtype", [np.float32, np.float64]) def test_reduce_float(func, dtype): # testing implementation in IS_BINARY_REDUCE branch