Skip to content

Commit ab526f2

Browse files
committed
Drop support for remainder
1 parent 89719d2 commit ab526f2

File tree

3 files changed

+3
-37
lines changed

3 files changed

+3
-37
lines changed

mkl_umath/generate_umath.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -717,12 +717,8 @@ def english_upper(s):
717717
TD(inexactvec),
718718
),
719719
# 'arctan2':
720-
'remainder':
721-
Ufunc(2, 1, None,
722-
docstrings.get('numpy._core.umath.remainder'),
723-
None,
724-
TD(inexactvec),
725-
),
720+
# 'remainder': Intel(R) MKL function v?Remainder follows C's modulo operator,
721+
# but NumPy is expecting Python's one
726722
# 'divmod':
727723
# 'hypot':
728724
'isnan':

mkl_umath/src/mkl_umath_loops.c.src

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -835,36 +835,6 @@ mkl_umath_@TYPE@_@kind@(char **args, const npy_intp *dimensions, const npy_intp
835835
}
836836
/**end repeat1**/
837837

838-
void
839-
mkl_umath_@TYPE@_remainder(char **args, const npy_intp *dimensions, const npy_intp *steps, void *NPY_UNUSED(func))
840-
{
841-
const int contig = IS_BINARY_CONT(@type@, @type@);
842-
const int disjoint_or_same1 = DISJOINT_OR_SAME(args[0], args[2], dimensions[0], sizeof(@type@));
843-
const int disjoint_or_same2 = DISJOINT_OR_SAME(args[1], args[2], dimensions[0], sizeof(@type@));
844-
const int can_vectorize = contig && disjoint_or_same1 && disjoint_or_same2;
845-
int ignore_fpstatus = 0;
846-
847-
if (can_vectorize && dimensions[0] > VML_TRANSCEDENTAL_THRESHOLD) {
848-
ignore_fpstatus = 1;
849-
CHUNKED_VML_CALL3(v@s@Remainder, dimensions[0], @type@, args[0], args[1], args[2]);
850-
/* v@s@Remainder(dimensions[0], (@type@*) args[0], (@type@*) args[1], (@type@*) args[2]); */
851-
}
852-
else {
853-
BINARY_LOOP {
854-
const @type@ in1 = *(@type@ *)ip1;
855-
const @type@ in2 = *(@type@ *)ip2;
856-
int invalid_cases = !npy_isnan(in1) && in2 == 0;
857-
invalid_cases |= (in1 == NPY_INFINITY || in1 == -NPY_INFINITY) && !npy_isnan(in2);
858-
invalid_cases |= (in1 != NPY_INFINITY && in1 != -NPY_INFINITY) && (in2 == NPY_INFINITY || in2 == -NPY_INFINITY);
859-
ignore_fpstatus |= invalid_cases;
860-
divmod@c@(in1, in2, (@type@ *)op1);
861-
}
862-
}
863-
if (ignore_fpstatus) {
864-
feclearexcept(FE_UNDERFLOW | FE_INVALID);
865-
}
866-
}
867-
868838
/**begin repeat1
869839
* # kind = cos, sin, tan, arccos, arcsin, arctan, cosh, sinh, tanh, arccosh, arcsinh, arctanh, fabs, floor, ceil, rint, trunc, cbrt, sqrt, expm1, log, log1p, log10#
870840
* # func = cos, sin, tan, acos, asin, atan, cosh, sinh, tanh, acosh, asinh, atanh, fabs, floor, ceil, rint, trunc, cbrt, sqrt, expm1, log, log1p, log10#

mkl_umath/src/mkl_umath_loops.h.src

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
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,
6060
log1p, logical_and, logical_not, logical_or, logical_xor, multiply, modf,
61-
negative, nextafter, not_equal, positive, reciprocal, remainder, rint, sign, signbit, sin,
61+
negative, nextafter, not_equal, positive, reciprocal, rint, sign, signbit, sin,
6262
sinh, spacing, sqrt, square, subtract, tan, tanh, trunc#
6363
*/
6464
MKL_UMATH_API

0 commit comments

Comments
 (0)