Skip to content

Commit 0734959

Browse files
author
Vahid Tavanashad
committed
drop support for maximum and minimum
1 parent 181f870 commit 0734959

File tree

5 files changed

+9
-70
lines changed

5 files changed

+9
-70
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
* 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)
1111
* Added mkl implementation for complex data-types of `conjugate` and `absolute` functions [gh-86](https://github.com/IntelPython/mkl_umath/pull/86)
1212
* Enabled support of Python 3.13 [gh-101](https://github.com/IntelPython/mkl_umath/pull/101)
13-
* Added mkl implementation for complex data-types of `add`, `subtract`, `multiply` and `divide` functions [gh-88](https://github.com/IntelPython/mkl_umath/pull/88)
13+
* Added mkl implementation for complex data-types of `add`, `subtract`, `multiply` and `divide` functions [gh-102](https://github.com/IntelPython/mkl_umath/pull/102)
14+
15+
### Changed
16+
* Dropped support for `maximum` and `minimum` [gh-104](https://github.com/IntelPython/mkl_umath/pull/104)
1417

1518
## [0.2.0] - 2025-06-03
1619
This release updates `mkl_umath` to be aligned with both numpy-1.26.x and numpy-2.x.x.

mkl_umath/generate_umath.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -532,18 +532,8 @@ def english_upper(s):
532532
None,
533533
TD(inexactvec + cmplxvec, out='?'),
534534
),
535-
'maximum':
536-
Ufunc(2, 1, ReorderableNone,
537-
docstrings.get('numpy._core.umath.maximum'),
538-
None,
539-
TD(inexactvec + cmplxvec),
540-
),
541-
'minimum':
542-
Ufunc(2, 1, ReorderableNone,
543-
docstrings.get('numpy._core.umath.minimum'),
544-
None,
545-
TD(inexactvec + cmplxvec),
546-
),
535+
# 'maximum':
536+
# 'minimum':
547537
# 'clip':
548538
'fmax':
549539
Ufunc(2, 1, ReorderableNone,

mkl_umath/src/mkl_umath_loops.c.src

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,37 +1086,6 @@ mkl_umath_@TYPE@_@kind@(char **args, const npy_intp *dimensions, const npy_intp
10861086
}
10871087
/**end repeat1**/
10881088

1089-
/**begin repeat1
1090-
* #kind = maximum, minimum#
1091-
* #OP = >=, <=#
1092-
**/
1093-
void
1094-
mkl_umath_@TYPE@_@kind@(char **args, const npy_intp *dimensions, const npy_intp *steps, void *NPY_UNUSED(func))
1095-
{
1096-
if (IS_BINARY_REDUCE) {
1097-
{
1098-
BINARY_REDUCE_LOOP(@type@) {
1099-
const @type@ in2 = *(@type@ *)ip2;
1100-
/* Order of operations important for MSVC 2015 */
1101-
io1 = (io1 @OP@ in2 || isnan(io1)) ? io1 : in2;
1102-
}
1103-
*((@type@ *)iop1) = io1;
1104-
}
1105-
}
1106-
else {
1107-
BINARY_LOOP {
1108-
@type@ in1 = *(@type@ *)ip1;
1109-
const @type@ in2 = *(@type@ *)ip2;
1110-
/* Order of operations important for MSVC 2015 */
1111-
in1 = (in1 @OP@ in2 || isnan(in1)) ? in1 : in2;
1112-
*((@type@ *)op1) = in1;
1113-
}
1114-
}
1115-
feclearexcept(FE_ALL_EXCEPT); /* clear floatstatus */
1116-
}
1117-
/**end repeat1**/
1118-
1119-
11201089
void
11211090
mkl_umath_@TYPE@_conjugate(char **args, const npy_intp *dimensions, const npy_intp *steps, void *NPY_UNUSED(func))
11221091
{
@@ -1679,29 +1648,6 @@ mkl_umath_@TYPE@_sign(char **args, const npy_intp *dimensions, const npy_intp *s
16791648
#endif
16801649
}
16811650

1682-
/**begin repeat1
1683-
* #kind = maximum, minimum#
1684-
* #OP = CGE, CLE#
1685-
*/
1686-
void
1687-
mkl_umath_@TYPE@_@kind@(char **args, const npy_intp *dimensions, const npy_intp *steps, void *NPY_UNUSED(func))
1688-
{
1689-
BINARY_LOOP {
1690-
@ftype@ in1r = ((@ftype@ *)ip1)[0];
1691-
@ftype@ in1i = ((@ftype@ *)ip1)[1];
1692-
const @ftype@ in2r = ((@ftype@ *)ip2)[0];
1693-
const @ftype@ in2i = ((@ftype@ *)ip2)[1];
1694-
if ( !(isnan(in1r) || isnan(in1i) || @OP@(in1r, in1i, in2r, in2i))) {
1695-
in1r = in2r;
1696-
in1i = in2i;
1697-
}
1698-
((@ftype@ *)op1)[0] = in1r;
1699-
((@ftype@ *)op1)[1] = in1i;
1700-
}
1701-
feclearexcept(FE_ALL_EXCEPT); /* clear floatstatus */
1702-
}
1703-
/**end repeat1**/
1704-
17051651
/**begin repeat1
17061652
* #kind = fmax, fmin#
17071653
* #OP = CGE, CLE#

mkl_umath/src/mkl_umath_loops.h.src

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
* # kind = absolute, add, arccos, arccosh, arcsin, arcsinh, arctan, arctanh, cbrt, ceil, conjugate,
5858
copysign, cos, cosh, divide, divmod, isfinite, isinf, isnan, equal, exp, exp2, expm1, fabs,
5959
floor, fmax, fmin, frexp, greater, greater_equal, ldexp, less, less_equal, log, log2, log10,
60-
log1p, logical_and, logical_not, logical_or, logical_xor, maximum, minimum, multiply, modf,
60+
log1p, logical_and, logical_not, logical_or, logical_xor, multiply, modf,
6161
negative, nextafter, not_equal, positive, reciprocal, remainder, rint, sign, signbit, sin,
6262
sinh, spacing, sqrt, square, subtract, tan, tanh, trunc#
6363
*/
@@ -98,7 +98,7 @@ mkl_umath_@TYPE@_ldexp_long(char **args, const npy_intp *dimensions, const npy_i
9898

9999
/**begin repeat1
100100
* # kind = absolute, add, conjugate, divide, isfinite, isinf, isnan, equal, fmax, fmin, greater, greater_equal,
101-
less, less_equal, logical_and, logical_not, logical_or, logical_xor, maximum, minimum, multiply,
101+
less, less_equal, logical_and, logical_not, logical_or, logical_xor, multiply,
102102
not_equal, reciprocal, sign, square, subtract#
103103
*/
104104
MKL_UMATH_API

mkl_umath/tests/test_basic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def test_strided(func, dtype):
142142
assert np.allclose(mkl_res, np_res), f"Results for '{func}[strided]' do not match"
143143

144144

145-
@pytest.mark.parametrize("func", ["add", "subtract", "multiply", "divide", "maximum", "minimum", "fmax", "fmin"])
145+
@pytest.mark.parametrize("func", ["add", "subtract", "multiply", "divide", "fmax", "fmin"])
146146
@pytest.mark.parametrize("dtype", [np.float32, np.float64])
147147
def test_reduce_float(func, dtype):
148148
# testing implementation in IS_BINARY_REDUCE branch

0 commit comments

Comments
 (0)