Skip to content

Scope compile_hook to the installing task - #915

Open
AntonOresten wants to merge 1 commit into
JuliaGPU:mainfrom
AntonOresten:scoped-compile-hook
Open

Scope compile_hook to the installing task#915
AntonOresten wants to merge 1 commit into
JuliaGPU:mainfrom
AntonOresten:scoped-compile-hook

Conversation

@AntonOresten

Copy link
Copy Markdown

compile_hook was a global Ref. 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 with with(compile_hook => hook): it applies to the current task and tasks spawned within the scope, and nothing else. Reads via compile_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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant