Skip to content

Commit

Permalink
PERF: speed up nanmin/max with non-null axis for int32
Browse files Browse the repository at this point in the history
  • Loading branch information
qwhelan committed Jan 6, 2020
1 parent 8106e74 commit 445d376
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bottleneck/src/reduce_template.c
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,7 @@ REDUCE_ALL(NAME, DTYPE0) {
return PyLong_FromLongLong(extreme);
}

BN_OPT_3
REDUCE_ONE(NAME, DTYPE0) {
npy_DTYPE0 ai, extreme;
INIT_ONE(DTYPE0, DTYPE0)
Expand All @@ -584,8 +585,9 @@ REDUCE_ONE(NAME, DTYPE0) {
BN_BEGIN_ALLOW_THREADS
WHILE {
extreme = BIG_INT;
const npy_DTYPE0* pa = PA(DTYPE0);
FOR {
ai = AI(DTYPE0);
ai = SI(pa);
if (ai COMPARE extreme) extreme = ai;
}
YPP = extreme;
Expand Down

0 comments on commit 445d376

Please sign in to comment.