Repository navigation
[pocl] Backport upstream PR #2239 - #15001
Merged
vchuravy merged 1 commit intoOct 4, 2026
Merged
Conversation
Assisted-by: Claude Code (Opus 5.5)
vchuravy
enabled auto-merge (squash)
October 4, 2026 11:01
This was referenced Oct 4, 2026
Merged
vchuravy
added a commit
to JuliaGPU/KernelAbstractions.jl
that referenced
this pull request
Oct 4, 2026
….2.1+1 pocl_standalone_jll 7.2.1+1 includes the WorkitemLoops fix (pocl/pocl#2239, JuliaPackaging/Yggdrasil#15001), so implement `KI.sub_group_reduce` and `KI.sub_group_scan` with the native `cl_khr_subgroups` collectives where they have Julia's semantics, and only keep the workaround for the fallbacks with older builds. The version is checked at precompile time, since the compat bound can't distinguish builds. Note: PoCL's kernel cache doesn't distinguish 7.2.1+0 and +1, so binaries miscompiled by the former can be reused by the latter until the cache is cleared (pocl/pocl#2374, JuliaPackaging/Yggdrasil#15002). Assisted-by: Claude Code (Opus 5.5)
vchuravy
added a commit
to JuliaGPU/KernelAbstractions.jl
that referenced
this pull request
Oct 6, 2026
….2.1+1 pocl_standalone_jll 7.2.1+1 includes the WorkitemLoops fix (pocl/pocl#2239, JuliaPackaging/Yggdrasil#15001), so implement `KI.sub_group_reduce` and `KI.sub_group_scan` with the native `cl_khr_subgroups` collectives where they have Julia's semantics, and only keep the workaround for the fallbacks with older builds. The version is checked at precompile time, since the compat bound can't distinguish builds. Note: PoCL's kernel cache doesn't distinguish 7.2.1+0 and +1, so binaries miscompiled by the former can be reused by the latter until the cache is cleared (pocl/pocl#2374, JuliaPackaging/Yggdrasil#15002). Assisted-by: Claude Code (Opus 5.5)
vchuravy
added a commit
to JuliaGPU/KernelAbstractions.jl
that referenced
this pull request
Oct 10, 2026
….2.1+1 pocl_standalone_jll 7.2.1+1 includes the WorkitemLoops fix (pocl/pocl#2239, JuliaPackaging/Yggdrasil#15001), so implement `KI.sub_group_reduce` and `KI.sub_group_scan` with the native `cl_khr_subgroups` collectives where they have Julia's semantics, and only keep the workaround for the fallbacks with older builds. The version is checked at precompile time, since the compat bound can't distinguish builds. Note: PoCL's kernel cache doesn't distinguish 7.2.1+0 and +1, so binaries miscompiled by the former can be reused by the latter until the cache is cleared (pocl/pocl#2374, JuliaPackaging/Yggdrasil#15002). Assisted-by: Claude Code (Opus 5.5)
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.
Backports pocl/pocl#2239 (merged upstream, in
main) as patch0014of thepocl,pocl_nextandpocl_standaloneseries.The patch makes WorkitemLoops share compiler-expanded local memory (
__pocl_work_group_alloca) between the replicas of a parallel region.Bug: in PoCL 7.2.x, a branch with an early exit before a sub-group collective makes WorkitemLoops peel the first work-item into a replica. Bounds checks emit such early exits, for example in Julia's OpenCL.jl and KernelAbstractions.jl. Each replica then got its own scratch memory for the collective, so
sub_group_reduce_addand friends returned garbage with theloops/loopvecwork-group methods. JuliaGPU/OpenCL.jl#526 and JuliaGPU/KernelAbstractions.jl#831 need this to use the nativecl_khr_subgroupscollectives.Recipe changes:
lib/llvmopencl/WorkitemLoops.cc; the upstream test is left out, like the other test files of the series.pocl_standalonereaches the patches through its symlink topocl_next/bundled, so this also bumps its build trigger.Testing: I applied the series 0001–0014 to v7.2 (888c9774b) and built it locally against LLVM 23. Then I ran PoCL's regression tests plus a new test for this case, which exercises reduce, scan, broadcast and any after a branch with an early return:
loops,loopvecandcbs.release_7_2without the fix, it fails forloopsandloopvec.I didn't run a BinaryBuilder build locally.
🤖 Generated with Claude Code