Repository navigation
Use the default zeros and ones for the POCL back-end - #795
Conversation
The POCL back-end filled new arrays with a kernel that took the element type as an
argument. GPUCompiler cannot compile a kernel with a `Type{T}` argument when `T` is a
bits union such as `Union{Missing, Bool}`, so `zeros` and `ones` of such types threw.
POCL arrays are host `Array`s, so the generic `allocate` + `fill!` fallbacks in
KernelInterface work for them and handle bits unions.
Fixes #791
Benchmark ResultsShow table
Benchmark PlotsA plot of the benchmark results have been uploaded as an artifact to the workflow run for this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #795 +/- ##
==========================================
- Coverage 66.88% 66.66% -0.22%
==========================================
Files 24 24
Lines 2023 2010 -13
==========================================
- Hits 1353 1340 -13
Misses 670 670 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
This broke the intention of |
Ah, that wasn't particularly obvious. In any case, the kernel was broken so will need to be fixed, not simply reverted. |
Fixes #791.
The POCL back-end filled new arrays with
init_kernel(arr, f, ::Type{T}). On Julia 1.13 and earlier, GPUCompiler'scheck_invocationcannot handle aType{T}argument whenThas no unique representation, which includes bits unions such asUnion{Missing, Bool}. It callsfieldcounton it, which throws, sozerosandonesof those types failed. Julia master is not affected, because GPUCompiler turnsType{T}into aCore.TypeEgal{T}ghost argument there.POCL arrays are plain host
Arrays, so KernelInterface's genericallocate+fill!fallback works for them and handles bits unions. This PR removes the POCL overrides and theinit_kernelthey used. It also adds a POCL-only regression test. The test is kept out of the shared testsuite, because not every back-end supports bits-union arrays (OpenCL.jl'sCLArrayrejects them).release-0.9is not affected. It has no POCL back-end, and its nativeCPU()back-end runsinit_kernelwithout GPUCompiler.Once this is merged, JuliaGPU/AcceleratedKernels.jl#133's skip of the bits-union tests on this back-end can be removed.