PoCL: compute the typed index queries with % T - #807
Merged
Merged
Conversation
maleadt
added this pull request to stack #808
September 29, 2026 20:22
Contributor
Benchmark ResultsShow table
Benchmark PlotsA plot of the benchmark results have been uploaded as an artifact to the workflow run for this PR. |
`T(x)` is a checked conversion, which leaves a `throw_inexacterror` branch in every kernel using a typed index query. `% T` doesn't, but needs SPIRVIntrinsics 1.1.3 (JuliaGPU/OpenCL.jl#511): with older versions, InstCombine folds the truncated 3-D builtin load into a vector type SPIR-V can't represent.
maleadt
force-pushed
the
tb/pocl-spirvintrinsics-1.1.3
branch
from
September 30, 2026 04:57
f74eae2 to
ce7bd83
Compare
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.
Split off from #800, as requested in review.
PoCL's typed index queries used
T(x), a checked conversion, which leaves athrow_inexacterrorbranch in every kernel that asks for e.g.KI.get_global_id(Int32). This computes them withx % Tinstead.That needs SPIRVIntrinsics 1.1.3 (JuliaGPU/OpenCL.jl#511): with older versions, InstCombine folds
trunc(extractelement(load <3 x i64> @__spirv_BuiltIn…))into a load of a vector type SPIR-V can't represent (e.g.<24 x i8>), andspirv-valrejects the kernel. So the compat bound goes up to 1.1.3.The PoCL KernelInterface testsuite and the codegen checks pass locally.
Stacked on #803 (only for a linear stack; it doesn't depend on it). #800 is stacked on this.