diff --git a/CHANGELOG.md b/CHANGELOG.md index 839bbcc..8c2cc09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed * Dropped support for `maximum` and `minimum` [gh-104](https://github.com/IntelPython/mkl_umath/pull/104) * Used a common umath loop for `log2` function to match NumPy [gh-109](https://github.com/IntelPython/mkl_umath/pull/109) +* Dropped support for `remainder` function [gh-110](https://github.com/IntelPython/mkl_umath/pull/110) ## [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 f83b013..9de1112 100644 --- a/mkl_umath/generate_umath.py +++ b/mkl_umath/generate_umath.py @@ -532,8 +532,8 @@ def english_upper(s): None, TD(inexactvec + cmplxvec, out='?'), ), -# 'maximum': -# 'minimum': +# 'maximum': no dedicated Intel(R) MKL function +# 'minimum': no dedicated Intel(R) MKL function # 'clip': 'fmax': Ufunc(2, 1, ReorderableNone, @@ -717,13 +717,9 @@ def english_upper(s): TD(inexactvec), ), # 'arctan2': -'remainder': - Ufunc(2, 1, None, - docstrings.get('numpy._core.umath.remainder'), - None, - TD(inexactvec), - ), -# 'divmod': +# 'remainder': Intel(R) MKL function v?Remainder follows C's modulo operator, +# but NumPy is expecting Python's one +# 'divmod': TODO: check if it can be added # 'hypot': 'isnan': Ufunc(1, 1, None, diff --git a/mkl_umath/src/blocking_utils.h b/mkl_umath/src/blocking_utils.h index 4acd31b..7e5e433 100644 --- a/mkl_umath/src/blocking_utils.h +++ b/mkl_umath/src/blocking_utils.h @@ -27,7 +27,7 @@ #include "numpy/arrayobject.h" -/* Adapated from NumPy's source code. +/* Adapted from NumPy's source code. * https://github.com/numpy/numpy/blob/main/LICENSE.txt */ /* diff --git a/mkl_umath/src/fast_loop_macros.h b/mkl_umath/src/fast_loop_macros.h index ea5130c..3daf032 100644 --- a/mkl_umath/src/fast_loop_macros.h +++ b/mkl_umath/src/fast_loop_macros.h @@ -51,7 +51,7 @@ #define NPY_ASSUME_ALIGNED(p, b) #endif -/* Adapated from NumPy's source code. +/* Adapted from NumPy's source code. * https://github.com/numpy/numpy/blob/main/LICENSE.txt */ /** diff --git a/mkl_umath/src/mkl_umath_loops.c.src b/mkl_umath/src/mkl_umath_loops.c.src index e47477e..6e34fa0 100644 --- a/mkl_umath/src/mkl_umath_loops.c.src +++ b/mkl_umath/src/mkl_umath_loops.c.src @@ -48,7 +48,7 @@ #define USE_NUMPY_2 #endif -/* Adapated from NumPy's source code. +/* Adapted from NumPy's source code. * https://github.com/numpy/numpy/blob/main/LICENSE.txt */ /* @@ -835,36 +835,6 @@ mkl_umath_@TYPE@_@kind@(char **args, const npy_intp *dimensions, const npy_intp } /**end repeat1**/ -void -mkl_umath_@TYPE@_remainder(char **args, const npy_intp *dimensions, const npy_intp *steps, void *NPY_UNUSED(func)) -{ - const int contig = IS_BINARY_CONT(@type@, @type@); - const int disjoint_or_same1 = DISJOINT_OR_SAME(args[0], args[2], dimensions[0], sizeof(@type@)); - const int disjoint_or_same2 = DISJOINT_OR_SAME(args[1], args[2], dimensions[0], sizeof(@type@)); - const int can_vectorize = contig && disjoint_or_same1 && disjoint_or_same2; - int ignore_fpstatus = 0; - - if (can_vectorize && dimensions[0] > VML_TRANSCEDENTAL_THRESHOLD) { - ignore_fpstatus = 1; - CHUNKED_VML_CALL3(v@s@Remainder, dimensions[0], @type@, args[0], args[1], args[2]); - /* v@s@Remainder(dimensions[0], (@type@*) args[0], (@type@*) args[1], (@type@*) args[2]); */ - } - else { - BINARY_LOOP { - const @type@ in1 = *(@type@ *)ip1; - const @type@ in2 = *(@type@ *)ip2; - int invalid_cases = !npy_isnan(in1) && in2 == 0; - invalid_cases |= (in1 == NPY_INFINITY || in1 == -NPY_INFINITY) && !npy_isnan(in2); - invalid_cases |= (in1 != NPY_INFINITY && in1 != -NPY_INFINITY) && (in2 == NPY_INFINITY || in2 == -NPY_INFINITY); - ignore_fpstatus |= invalid_cases; - divmod@c@(in1, in2, (@type@ *)op1); - } - } - if (ignore_fpstatus) { - feclearexcept(FE_UNDERFLOW | FE_INVALID); - } -} - /**begin repeat1 * # kind = cos, sin, tan, arccos, arcsin, arctan, cosh, sinh, tanh, arccosh, arcsinh, arctanh, fabs, floor, ceil, rint, trunc, cbrt, sqrt, expm1, log, log2, log1p, log10# * # func = cos, sin, tan, acos, asin, atan, cosh, sinh, tanh, acosh, asinh, atanh, fabs, floor, ceil, rint, trunc, cbrt, sqrt, expm1, log, log2, log1p, log10# diff --git a/mkl_umath/src/mkl_umath_loops.h.src b/mkl_umath/src/mkl_umath_loops.h.src index a9f7d63..714c877 100644 --- a/mkl_umath/src/mkl_umath_loops.h.src +++ b/mkl_umath/src/mkl_umath_loops.h.src @@ -58,7 +58,7 @@ 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, multiply, modf, - negative, nextafter, not_equal, positive, reciprocal, remainder, rint, sign, signbit, sin, + negative, nextafter, not_equal, positive, reciprocal, rint, sign, signbit, sin, sinh, spacing, sqrt, square, subtract, tan, tanh, trunc# */ MKL_UMATH_API