Scope compile_hook to the installing task - #915
Open
AntonOresten wants to merge 1 commit into
Open
Conversation
AntonOresten
force-pushed
the
scoped-compile-hook
branch
from
August 27, 2026 16:42
869b77e to
aa884fe
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
compile_hookwas a globalRef. With compilations running in other tasks (an autotuning sweep, say) a@device_code_*macro observed their jobs too, and its own "disable the hook while the user hook runs" write clobbered what those tasks saw.It is now a
ScopedValue, installed withwith(compile_hook => hook): it applies to the current task and tasks spawned within the scope, and nothing else. Reads viacompile_hook[]are unchanged, so back-ends need no changes. The macros' per-invocation job set is locked, since hooked compilations may now run concurrently within the scope; the user hook itself runs outside the lock.Depends on ScopedValues.jl for Julia 1.10.
Made with Fable