Skip to content

[KernelInterface 0.2] Take an element type in the indexing queries - #754

Open
christiangnrd wants to merge 4 commits into
mainfrom
idxtyp
Open

[KernelInterface 0.2] Take an element type in the indexing queries#754
christiangnrd wants to merge 4 commits into
mainfrom
idxtyp

Conversation

@christiangnrd

@christiangnrd christiangnrd commented Sep 8, 2026

Copy link
Copy Markdown
Member

Ignore backend tests

This is something that people seem to really want.

Yet undocumented caveat that the eltype should be the same in every query for a kernel.

Is this a decent interface?

christiangnrd and others added 3 commits September 8, 2026 13:12
`get_global_size`, `get_global_id`, `get_local_size`, `get_local_id`,
`get_num_groups` and `get_group_id` now accept an optional element type
and return a `@NamedTuple{x::T, y::T, z::T}`. The zero-argument form
forwards to `Int`; backends implement only the typed form.

The POCL backend converts with `T(...)` rather than `% T`: with a plain
truncation LLVM folds the `<3 x i64>` builtin load into a `<6 x i32>`
load, which SPIR-V rejects.

Adds typed return-type and value tests to the interface testsuite and
updates the standalone stub tests and documentation.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@christiangnrd christiangnrd added this to the 0.10.0 milestone Sep 8, 2026
@christiangnrd

Copy link
Copy Markdown
Member Author

Added to milestone because we should make a decision before 0.10, not because this needs to be merged

Comment thread lib/KernelInterface/src/device.jl Outdated
@christiangnrd christiangnrd changed the title [RFC] [KernelInterface] Take an element type in the indexing queries [KernelInterface] Take an element type in the indexing queries Sep 8, 2026
@christiangnrd christiangnrd changed the title [KernelInterface] Take an element type in the indexing queries [KernelInterface 0.2] Take an element type in the indexing queries Sep 8, 2026
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.

2 participants