Skip to content

Commit 4de90e0

Browse files
vchuravyclaude
andcommitted
Drop GPUCompiler branch pin now that 2.0 is released
Remove the `[sources]` pin to the `tb/compilercaching` branch; the caching API it relied on shipped in the registered GPUCompiler 2.0 (compat is already `"2"`). Adapt `compile_or_lookup` to the released `cached_results` API: it now returns `nothing` until code exists for the job (rather than always materializing an empty results struct), so re-fetch after compiling — which populates Julia's code cache — via `@something`. Matches the final form merged in JuliaGPU/OpenCL.jl#431. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 9f3cf88 commit 4de90e0

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

Project.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
2222
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
2323
pocl_standalone_jll = "54f56a70-6062-5590-a942-1226658f6c83"
2424

25-
[sources]
26-
GPUCompiler = {url = "https://github.com/JuliaGPU/GPUCompiler.jl", rev = "tb/compilercaching"}
27-
2825
[weakdeps]
2926
EnzymeCore = "f151be2c-9106-41f4-ab19-57ee4f262869"
3027
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

src/pocl/compiler/execution.jl

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,13 +233,16 @@ end
233233
# by `GPUCompiler.cached_results` (Julia's integrated code cache on 1.11+, which also
234234
# persists artifacts through precompilation; a session-local store on 1.10).
235235
#
236-
# `obj === nothing` identifies an `OpenCLResults` that hasn't been compiled yet. The
237-
# `compile_hook` check additionally forces the compile path so reflection-style
238-
# consumers (`@device_code_*`) observe the compilation even on a cache hit.
236+
# `cached_results` returns `nothing` until code exists for the job; `obj === nothing`
237+
# then identifies an `OpenCLResults` that hasn't been compiled yet. Compiling populates
238+
# Julia's code cache, so the post-compile `cached_results` re-fetch is guaranteed to
239+
# succeed. The `compile_hook` check additionally forces the compile path so
240+
# reflection-style consumers (`@device_code_*`) observe the compilation even on a hit.
239241
function compile_or_lookup(@nospecialize(job::CompilerJob))::OpenCLResults
240242
res = GPUCompiler.cached_results(OpenCLResults, job)
241-
if res.obj === nothing || GPUCompiler.compile_hook[] !== nothing
243+
if res === nothing || res.obj === nothing || GPUCompiler.compile_hook[] !== nothing
242244
compiled = compile_to_obj(job)
245+
res = @something res GPUCompiler.cached_results(OpenCLResults, job)
243246
res.obj = compiled.obj
244247
res.entry = compiled.entry
245248
res.device_rng = compiled.device_rng

0 commit comments

Comments
 (0)