Skip to content

Commit 45db370

Browse files
dennisYatuninclaude
andcommitted
Remove inlining annotations from parallelize_over
The annotations were compensating for the removal of the ThisThread method of foreach_slice: with every loop routed through parallelize_over, inlining was the only way to elide the closure on single-threaded paths. Now that single-threaded and nested loops dispatch to the ThisThread method and never construct the closure, the generic parallelize_over only runs inside GPU kernels, which are compiled with always_inline = true, and the CPU thread pool has its own method. Verified without the annotations: zero allocations in unit_loops.jl on Julia 1.10.11 (single-threaded and --threads=4) and 1.11.9, unchanged JET budgets in opt_spaces.jl, and unchanged device-free kernel compilation checks. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 279f9dd commit 45db370

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/DataLayouts/scopes.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,7 @@ partition_rank(scope) = subscope_rank(partition(scope), scope)
123123
Calls `f()` from each thread in a [`DataScope`](@ref). Code that appears outside
124124
of this instruction is not necessarily parallelized over all available threads.
125125
"""
126-
@inline parallelize_over(f::F, _) where {F} = @inline f()
127-
# Inline both parallelize_over and f to avoid unnecessary compilation overhead.
126+
parallelize_over(f::F, _) where {F} = f()
128127

129128
"""
130129
synchronize(scope)

0 commit comments

Comments
 (0)