Skip to content
Merged
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
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
14 changes: 2 additions & 12 deletions mkl_umath/generate_umath.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
54 changes: 0 additions & 54 deletions mkl_umath/src/mkl_umath_loops.c.src
Original file line number Diff line number Diff line change
Expand Up @@ -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))
{
Expand Down Expand Up @@ -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#
Expand Down
4 changes: 2 additions & 2 deletions mkl_umath/src/mkl_umath_loops.h.src
Original file line number Diff line number Diff line change
Expand Up @@ -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#
*/
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion mkl_umath/tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading