Skip to content

Commit

Permalink
Fix the inference error by removing assume_effects (#245)
Browse files Browse the repository at this point in the history
  • Loading branch information
asinghvi17 authored Jan 9, 2025
1 parent 39b51f9 commit ae6c92c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions GeometryOpsCore/src/apply.jl
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,12 @@ using Base.Threads: nthreads, @threads, @spawn
return mapreduce(fetch, vcat, tasks)
end
#=
Here we use the compiler directive `@assume_effects :foldable` to force the compiler
Here we used to use the compiler directive `@assume_effects :foldable` to force the compiler
to lookup through the closure. This alone makes e.g. `flip` 2.5x faster!
But it caused inference to fail, so we've removed it. No effect on runtime so far as we can tell,
at least in Julia 1.11.
=#
Base.@assume_effects :foldable @inline function _maptasks(f::F, taskrange, threaded::_False)::Vector where F
@inline function _maptasks(f::F, taskrange, threaded::_False)::Vector where F
map(f, taskrange)
end

0 comments on commit ae6c92c

Please sign in to comment.