Skip to content

Commit f0bd1e2

Browse files
authored
Merge pull request #218 from JuliaDynamics/hw/functionbarrier
use function barrier for inhomogeneous array batches
2 parents a9c04d0 + 7cc0471 commit f0bd1e2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/utils.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ end
5151
@inline unrolled_foreach(f::F1, filter::F2, t::Tuple{}) where {F1,F2} = nothing
5252
# Abstract Vector, no unrolling
5353
@inline function unrolled_foreach(f::F1, filter::F2, t::AbstractVector) where {F1,F2}
54-
@inline foreach(f, Iterators.filter(filter, t))
54+
for el in t
55+
filter(el) && @noinline f(el) #noinline as function barrier for unknown batch type
56+
end
57+
nothing
5558
end
5659
# no filter
5760
@inline unrolled_foreach(f, t) = unrolled_foreach(f, nofilt, t)

0 commit comments

Comments
 (0)