Skip to content

kernel.workgroup.id

kernel dialect

Read one coordinate of the current workgroup within the dispatch grid. The result is a logical index value; target lowering decides whether the coordinate is carried in scalar registers, ABI state, or target-specific builtin values.

Operation contract

Property Value
Semantic phase executable
Traits Pure, HasAncestor(kernel.def)

Signature

Kind Name Type Cardinality Description
Result result index required Current workgroup coordinate in the selected dimension.
Attribute dimension enum KernelDimension required Coordinate axis to read.

Examples

%bid = kernel.workgroup.id<x> : index