Skip to content

Commit e421b78

Browse files
committed
No need to have a separate loop for log2
1 parent 89719d2 commit e421b78

File tree

1 file changed

+3
-34
lines changed

1 file changed

+3
-34
lines changed

mkl_umath/src/mkl_umath_loops.c.src

Lines changed: 3 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -866,9 +866,9 @@ mkl_umath_@TYPE@_remainder(char **args, const npy_intp *dimensions, const npy_in
866866
}
867867

868868
/**begin repeat1
869-
* # kind = cos, sin, tan, arccos, arcsin, arctan, cosh, sinh, tanh, arccosh, arcsinh, arctanh, fabs, floor, ceil, rint, trunc, cbrt, sqrt, expm1, log, log1p, log10#
870-
* # func = cos, sin, tan, acos, asin, atan, cosh, sinh, tanh, acosh, asinh, atanh, fabs, floor, ceil, rint, trunc, cbrt, sqrt, expm1, log, log1p, log10#
871-
* # VML = Cos, Sin, Tan, Acos, Asin, Atan, Cosh, Sinh, Tanh, Acosh, Asinh, Atanh, Abs, Floor, Ceil, Rint, Trunc, Cbrt, Sqrt, Expm1, Ln, Log1p, Log10#
869+
* # 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#
870+
* # 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#
871+
* # VML = Cos, Sin, Tan, Acos, Asin, Atan, Cosh, Sinh, Tanh, Acosh, Asinh, Atanh, Abs, Floor, Ceil, Rint, Trunc, Cbrt, Sqrt, Expm1, Ln, Log2, Log1p, Log10#
872872
*/
873873
void
874874
mkl_umath_@TYPE@_@kind@(char **args, const npy_intp *dimensions, const npy_intp *steps, void *NPY_UNUSED(func))
@@ -931,37 +931,6 @@ mkl_umath_@TYPE@_@kind@(char **args, const npy_intp *dimensions, const npy_intp
931931
}
932932
/**end repeat1**/
933933

934-
void
935-
mkl_umath_@TYPE@_log2(char **args, const npy_intp *dimensions, const npy_intp *steps, void *NPY_UNUSED(func))
936-
{
937-
const int contig = IS_UNARY_CONT(@type@, @type@);
938-
const int disjoint_or_same = DISJOINT_OR_SAME(args[0], args[1], dimensions[0], sizeof(@type@));
939-
const int can_vectorize = contig && disjoint_or_same;
940-
int ignore_fpstatus = 0;
941-
942-
if (can_vectorize && dimensions[0] > VML_TRANSCEDENTAL_THRESHOLD)
943-
{
944-
ignore_fpstatus = 1;
945-
CHUNKED_VML_CALL2(v@s@Log2, dimensions[0], @type@, args[0], args[1]);
946-
/* v@s@Log2(dimensions[0], (@type@*) args[0], (@type@*) args[1]); */
947-
}
948-
else {
949-
UNARY_LOOP_DISPATCH(
950-
@type@, @type@
951-
,
952-
can_vectorize
953-
,
954-
const @type@ in1 = *(@type@ *)ip1;
955-
const int invalid_cases = in1 < 0 || in1 == 0 || npy_isnan(in1) || in1 == -NPY_INFINITY;
956-
ignore_fpstatus |= invalid_cases;
957-
*(@type@ *)op1 = log2@c@(in1);
958-
)
959-
}
960-
if (ignore_fpstatus) {
961-
feclearexcept(FE_DIVBYZERO | FE_INVALID);
962-
}
963-
}
964-
965934
void
966935
mkl_umath_@TYPE@_absolute(char **args, const npy_intp *dimensions, const npy_intp *steps, void *NPY_UNUSED(func))
967936
{

0 commit comments

Comments
 (0)