Repository navigation
Support GPUArrays 12 - #541
Merged
Merged
Conversation
maleadt
marked this pull request as ready for review
October 7, 2026 06:17
maleadt
force-pushed
the
tb/gpuarrays-12
branch
5 times, most recently
from
October 9, 2026 11:05
45e4c30 to
8ff7fe4
Compare
GPUArrays 12 implements Base's reductions on AcceleratedKernels and no longer calls the GPUArrays.mapreducedim! hook, so OpenCL.jl's reduction kernel is removed. GPUArrays.default_rng is gone too; the per-device RNG backing rand!, randn! and seed! now lives in OpenCL.jl and constructs GPUArrays' stateless RNG directly.
Base.dataids returned the array's own pointer, which missed overlaps between a contiguous view (a CLArray at an offset) and a wrapped array of the same memory, and the byte-range mightalias let empty arrays alias. GPUArrays 12.1 defines `Base.dataids` and `Base.mightalias` for every GPU array from where its elements live, so implement that hook instead. Read the address from the memory object rather than using pointer(A), which takes ownership of the memory, and use the handle of buffers without an address.
maleadt
force-pushed
the
tb/gpuarrays-12
branch
from
October 10, 2026 20:34
432c8c7 to
957f4bb
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #541 +/- ##
==========================================
- Coverage 87.39% 86.06% -1.33%
==========================================
Files 18 17 -1
Lines 1705 1615 -90
==========================================
- Hits 1490 1390 -100
- Misses 215 225 +10 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Ports OpenCL.jl to GPUArrays 12. GPUArrays 12 implements Base's reductions, sorting, scans,
findall, logical indexing andreverseonce for every GPU array, on AcceleratedKernels 0.5 (JuliaGPU/GPUArrays.jl#790), and no longer calls theGPUArrays.mapreducedim!hook. OpenCL.jl getssort!,accumulateand the rest for free.src/mapreduce.jl) and the test of the hook.GPUArrays.default_rngandRNG(state)are gone in GPUArrays 12, so the per-device RNG now lives ingpuarrays_rng()and constructs GPUArrays' statelessRNG{CLArray}()directly.Intended as a minor release (0.10.13; AcceleratedKernels' weakdep compat is
OpenCL = "0.10").Tested with pocl on Julia 1.13 (
poclandpoclctargets): 30,582 pass (main: 27,946). There are 16 errors, both fixed upstream:cholesky(::Diagonal)(6): a closure capturing aComposedFunctiondoesn't adapt inferably. Fixed in Keep the closure rule inferable when it recurses Adapt.jl#124.dimsreductions onpoclc(10): spirv2clc can't translatectz. Fixed in Avoid trailing_zeros in the strided reduction's offset decode AcceleratedKernels.jl#148.