Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove all recursion limits #15

Merged
merged 1 commit into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

Loading