Skip to content

Commit

Permalink
Merge pull request #15 from CliMA/dy/recursion_limit
Browse files Browse the repository at this point in the history
Remove all recursion limits
  • Loading branch information
dennisYatunin authored Oct 16, 2024
2 parents 3d90cc3 + e8c9311 commit 2d471e1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 60 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/invalidations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
steps:
- uses: julia-actions/setup-julia@v1
with:
version: '1'
version: '1.10' # JET and SnoopCompile do not yet support Julia 1.11
- uses: actions/checkout@v4
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-invalidations@v1
Expand Down
14 changes: 11 additions & 3 deletions src/UnrolledUtilities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ include("generatively_unrolled_functions.jl")
val_unrolled_reduce(op, val_N, init)

@inline unrolled_mapreduce(f, op, itrs...; init = NoInit()) =
unrolled_reduce(op, Iterators.map(f, itrs...), init)
unrolled_reduce(op, unrolled_map(f, itrs...), init)

@inline unrolled_accumulate_into_tuple(op, itr, init, transform) =
(rec_unroll(itr) ? rec_unrolled_accumulate : gen_unrolled_accumulate)(
Expand Down Expand Up @@ -148,7 +148,7 @@ include("generatively_unrolled_functions.jl")
unrolled_reduce(unrolled_append, itr; init = promoted_empty(itr))

@inline unrolled_flatmap(f, itrs...) =
unrolled_flatten(Iterators.map(f, itrs...))
unrolled_flatten(unrolled_map(f, itrs...))

@inline unrolled_product(itrs...) =
unrolled_reduce(itrs; init = (promoted_empty(itrs),)) do product_itr, itr
Expand All @@ -172,6 +172,14 @@ abstract type StaticSequence{N} end
include("StaticOneTo.jl")
include("StaticBitVector.jl")

include("recursion_limits.jl") # This must be included at the end of the module.
# Remove the default recursion limit from every function defined in this module.
@static if hasfield(Method, :recursion_relation)
module_names = names(@__MODULE__; all = true)
module_values = map(Base.Fix1(getproperty, @__MODULE__), module_names)
module_functions = filter(Base.Fix2(isa, Function), module_values)
for f in module_functions, method in methods(f)
method.recursion_relation = Returns(true)
end
end

end
56 changes: 0 additions & 56 deletions src/recursion_limits.jl

This file was deleted.

0 comments on commit 2d471e1

Please sign in to comment.