Skip to content

Conversation

christiangnrd
Copy link
Member

Playing around with the Asahi linux rusticl zink driver exposed a few oversights in the testsuite.

This PR changes memory backend-specific tests to only run when testing the relevant backend since support for the other backends cannot be assumed and if it is supported, presumably it will be tested separately.

This also disables the event tests on rusticl since the tests were crashing on a deprecated function (clEnqueueWaitForEvents) on asahi linux. However, I'm not committing to maintaining opencl with rusticl or asahi linux, so I can revert that commit if desired.

Impressively, after these changes, I only get 3 failures (and probably a few heisenbugs) when using the distro's OpenCL and launching julia with

$ RUSTICL_ENABLE=zink julia +1.11 --project
`OpenCL.versioninfo` & Test summary
┌ Info: System information:
│ OpenCL.jl version 0.10.5
│
│ Toolchain:
│  - Julia v1.11.7
│  - OpenCL: 2024.10.24+1
│  - SPIRV_LLVM_Backend: 20.1.5+2
│
│ Available platforms: 2
│  - Portable Computing Language
│    OpenCL 3.0, PoCL 7.0  Linux, Release, RELOC, SPIR-V, LLVM 20.1.2jl, SLEEF, DISTRO, POCL_DEBUG
│    · cpu-apple-m2-0x038 (svm:c+f, usm:h+d, bda, fp64, il)
│  - rusticl
│    OpenCL 3.0
└    · zink Vulkan 1.4(Apple M2 Max (G14C B1) (MESA_HONEYKRISP)) (svm:, bda, fp16, il)

Test Summary:                                    | Pass  Fail  Error  Total  Time
  Overall                                        | 9294     2      1   9297
    buffer                                       |    9                   9
    pointer                                      |   37                  37
    context                                      |   14                  14
    device                                       |   13                  13
    behaviour                                    | 1028                1028
    array                                        |   25                  25
    kernel                                       |   20                  20
    cmdqueue                                     |   11                  11
    event                                        |                        0
    program                                      |   21                  21
    platform                                     |   10                  10
    memory                                       |    7                   7
    gpuarrays/alloc cache                        |   37                  37
    intrinsics                                   |                        0
    atomics                                      |    2                   2
    execution                                    |   22                  22
    gpuarrays/indexing scalar                    |  399                 399
    gpuarrays/indexing find                      |   45                  45
    kernelabstractions                           |                 1      1
    gpuarrays/math/power                         |   60                  60
    gpuarrays/linalg/mul!/vector-matrix          |  140                 140
    gpuarrays/uniformscaling                     |   56                  56
    gpuarrays/indexing multidimensional          |   89                  89
    gpuarrays/reductions/any all count           |  101                 101
    gpuarrays/reductions/mapreducedim!_large     |   40                  40
    gpuarrays/reductions/reducedim!              |  160                 160
    gpuarrays/math/intrinsics                    |   10                  10
    gpuarrays/linalg/NaN_false                   |   36                  36
    gpuarrays/linalg/norm                        |  264                 264
    gpuarrays/statistics                         |   52                  52
    gpuarrays/linalg/mul!/matrix-matrix          |  360                 360
    gpuarrays/vectors                            |   10                  10
    gpuarrays/random                             |   52                  52
    gpuarrays/linalg                             |  579                 579
    gpuarrays/ext/jld2                           |   90                  90
    gpuarrays/constructors                       |  832                 832
    gpuarrays/reductions/minimum maximum extrema |  555                 555
    gpuarrays/base                               |   96                  96
    gpuarrays/reductions/mapreducedim!           |  260                 260
    gpuarrays/reductions/mapreduce               | 1290                1290
    gpuarrays/reductions/== isequal              |  230                 230
    gpuarrays/reductions/reduce                  | 1279                1279
    gpuarrays/reductions/sum prod                |  636                 636
    gpuarrays/broadcasting                       |  317     2           319
    FAILURE

@github-actions
Copy link
Contributor

Your PR requires formatting changes to meet the project's style guidelines.
Please consider running Runic (git runic master) to apply these changes.

Click here to view the suggested changes.
diff --git a/test/intrinsics.jl b/test/intrinsics.jl
index bad6838..2d4a26d 100644
--- a/test/intrinsics.jl
+++ b/test/intrinsics.jl
@@ -17,7 +17,7 @@
 @on_device work_group_barrier(OpenCL.LOCAL_MEM_FENCE, OpenCL.memory_scope_work_item)
 @on_device work_group_barrier(OpenCL.LOCAL_MEM_FENCE, OpenCL.memory_scope_work_group)
 @on_device work_group_barrier(OpenCL.LOCAL_MEM_FENCE, OpenCL.memory_scope_device)
-cl.memory_backend() isa cl.SVMBackend && @on_device work_group_barrier(OpenCL.LOCAL_MEM_FENCE, OpenCL.memory_scope_all_svm_devices)
+        cl.memory_backend() isa cl.SVMBackend && @on_device work_group_barrier(OpenCL.LOCAL_MEM_FENCE, OpenCL.memory_scope_all_svm_devices)
 @on_device work_group_barrier(OpenCL.LOCAL_MEM_FENCE, OpenCL.memory_scope_sub_group)
 
 end
@@ -43,7 +43,7 @@ end
 @on_device atomic_work_item_fence(OpenCL.LOCAL_MEM_FENCE, OpenCL.memory_order_relaxed, OpenCL.memory_scope_work_item)
 @on_device atomic_work_item_fence(OpenCL.GLOBAL_MEM_FENCE, OpenCL.memory_order_acquire, OpenCL.memory_scope_work_group)
 @on_device atomic_work_item_fence(OpenCL.IMAGE_MEM_FENCE, OpenCL.memory_order_release, OpenCL.memory_scope_device)
-cl.memory_backend() isa cl.SVMBackend && @on_device atomic_work_item_fence(OpenCL.LOCAL_MEM_FENCE, OpenCL.memory_order_acq_rel, OpenCL.memory_scope_all_svm_devices)
+        cl.memory_backend() isa cl.SVMBackend && @on_device atomic_work_item_fence(OpenCL.LOCAL_MEM_FENCE, OpenCL.memory_order_acq_rel, OpenCL.memory_scope_all_svm_devices)
 @on_device atomic_work_item_fence(OpenCL.GLOBAL_MEM_FENCE, OpenCL.memory_order_seq_cst, OpenCL.memory_scope_sub_group)
 @on_device atomic_work_item_fence(OpenCL.IMAGE_MEM_FENCE | OpenCL.LOCAL_MEM_FENCE, OpenCL.memory_order_acquire, OpenCL.memory_scope_sub_group)
 

@codecov
Copy link

codecov bot commented Oct 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.01%. Comparing base (9278295) to head (11d5196).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #382   +/-   ##
=======================================
  Coverage   79.01%   79.01%           
=======================================
  Files          12       12           
  Lines         672      672           
=======================================
  Hits          531      531           
  Misses        141      141           

☔ View full report in Codecov by Sentry.
📢 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.

@simeonschaub simeonschaub enabled auto-merge (squash) October 13, 2025 13:49
@simeonschaub
Copy link
Member

Thanks!

@simeonschaub simeonschaub merged commit 6f54c25 into JuliaGPU:master Oct 13, 2025
38 of 45 checks passed
@christiangnrd christiangnrd deleted the nosvmfix branch October 13, 2025 14:41
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.

3 participants