Use the default zeros and ones for the POCL back-end - #795
Merged
Merged
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
Contributor
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 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.
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.