Skip to content

Commit eebd4b8

Browse files
committed
cleanup
1 parent 5fa3595 commit eebd4b8

File tree

1 file changed

+3
-20
lines changed

1 file changed

+3
-20
lines changed

src/nditeration.jl

+3-20
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ end
3636

3737
_ind2sub_recuse(::Tuple{}, ind) = (ind+1,)
3838
function _ind2sub_recurse(indslast::NTuple{1}, ind)
39-
@inline
39+
Base.@_inline_meta
4040
(_lookup(ind, indslast[1]),)
4141
end
4242

4343
function _ind2sub_recurse(inds, ind)
44-
@inline
44+
Base.@_inline_meta
4545
inv = inds[1]
4646
indnext, f, l = _div(ind, inv)
4747
(ind-l*indnext+f, _ind2sub_recurse(Base.tail(inds), indnext)...)
@@ -54,7 +54,7 @@ function _div(ind, inv::SignedMultiplicativeInverse)
5454
end
5555

5656
function Base._ind2sub(inv::FastCartesianIndices, ind)
57-
@inline
57+
Base.@_inline_meta
5858
_ind2sub_recurse(inv.inverses, ind-1)
5959
end
6060

@@ -151,24 +151,7 @@ Base.length(range::NDRange) = length(blocks(range))
151151
end
152152

153153
Base.@propagate_inbounds function expand(ndrange::NDRange{N}, groupidx::Integer, idx::Integer) where {N}
154-
# This causes two sdiv operations, one for each Linear to CartesianIndex
155154
return expand(ndrange, blocks(ndrange)[groupidx], workitems(ndrange)[idx])
156-
157-
# The formulation below saves one sdiv
158-
# but leads to a different index order...
159-
# previous: julia> expand(ndrange, 1, 32*32)
160-
# CartesianIndex(32, 32)
161-
# now: julia> expand(ndrange, 1, 32*32)
162-
# CartesianIndex(1024, 1)
163-
# B = blocks(ndrange)::CartesianIndices
164-
# W = workitems(ndrange)::CartesianIndices
165-
# Ind = ntuple(Val(N)) do I
166-
# Base.@_inline_meta
167-
# b = B.indices[I]
168-
# w = W.indices[I]
169-
# length(b) * length(w)
170-
# end
171-
# CartesianIndices(Ind)[(groupidx-1)* prod(size(W)) + idx]
172155
end
173156

174157
Base.@propagate_inbounds function expand(ndrange::NDRange{N}, groupidx::CartesianIndex{N}, idx::Integer) where {N}

0 commit comments

Comments
 (0)