Skip to content

Support GPUArrays 12 - #541

Merged
maleadt merged 3 commits into
mainfrom
tb/gpuarrays-12
Oct 11, 2026
Merged

maleadt merged 3 commits into
mainfrom
tb/gpuarrays-12

Conversation

@maleadt

@maleadt maleadt commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

Ports OpenCL.jl to GPUArrays 12. GPUArrays 12 implements Base's reductions, sorting, scans, findall, logical indexing and reverse once for every GPU array, on AcceleratedKernels 0.5 (JuliaGPU/GPUArrays.jl#790), and no longer calls the GPUArrays.mapreducedim! hook. OpenCL.jl gets sort!, accumulate and the rest for free.

  • Removes OpenCL.jl's reduction kernel (src/mapreduce.jl) and the test of the hook.
  • GPUArrays.default_rng and RNG(state) are gone in GPUArrays 12, so the per-device RNG now lives in gpuarrays_rng() and constructs GPUArrays' stateless RNG{CLArray}() directly.

Intended as a minor release (0.10.13; AcceleratedKernels' weakdep compat is OpenCL = "0.10").

Tested with pocl on Julia 1.13 (pocl and poclc targets): 30,582 pass (main: 27,946). There are 16 errors, both fixed upstream:

@maleadt
maleadt marked this pull request as ready for review October 7, 2026 06:17
@maleadt
maleadt force-pushed the tb/gpuarrays-12 branch 5 times, most recently from 45e4c30 to 8ff7fe4 Compare October 9, 2026 11:05
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.
@codecov

codecov Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.06%. Comparing base (8721db2) to head (957f4bb).

Files with missing lines Patch % Lines
src/random.jl 0.00% 4 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@maleadt
maleadt merged commit 7b8d2c4 into main Oct 11, 2026
16 checks passed
@maleadt
maleadt deleted the tb/gpuarrays-12 branch October 11, 2026 09:10
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