Skip to content
This repository was archived by the owner on May 4, 2019. It is now read-only.

Commit 513c046

Browse files
tkelmanararslan
authored andcommitted
delete _mapreducedim! method on Base types (#275)
if this is still an improvement in performance, it should be done in Base, not here
1 parent 77c2592 commit 513c046

File tree

1 file changed

+0
-24
lines changed

1 file changed

+0
-24
lines changed

src/reducedim.jl

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,6 @@
22

33
using Base.check_reducedims
44

5-
# This is a substantially faster implementation of the "all" reduction
6-
# across dimensions for reducing a BitArray to an Array{Bool}. We use
7-
# this below for implementing MaxFun and MinFun with skipna=true.
8-
@generated function Base._mapreducedim!(f, op::typeof(&), R::Array{Bool}, A::BitArray{N}) where {N}
9-
quote
10-
lsiz = check_reducedims(R, A)
11-
isempty(A) && return R
12-
@nextract $N sizeR d->size(R, d)
13-
@nexprs 1 d->(state_0 = state_{$N} = 1)
14-
@nexprs $N d->(skip_d = sizeR_d == 1)
15-
Achunks = A.chunks
16-
k = 1
17-
@nloops($N, i, A,
18-
d->(state_{d-1} = state_d),
19-
d->(skip_d || (state_d = state_0)),
20-
begin
21-
@inbounds R[state_0] &= f(Base.unsafe_bitgetindex(Achunks, k))
22-
state_0 += 1
23-
k += 1
24-
end)
25-
R
26-
end
27-
end
28-
295
# Determine if there are any true values in a BitArray in a given
306
# range. We use this for reductions with skipna=false along the first
317
# dimension.

0 commit comments

Comments
 (0)