kernel.workitem.id
← kernel dialect
Read one coordinate of the current invocation within its workgroup. The result is a logical index value, not a byte offset; target lowering decides whether the coordinate is carried in scalar, vector, or dedicated target registers.
Operation contract
| Property |
Value |
| Semantic phase |
executable |
| Traits |
Pure, HasAncestor(kernel.def) |
Signature
| Kind |
Name |
Type |
Cardinality |
Description |
| Result |
result |
index |
required |
Current workitem coordinate in the selected dimension. |
| Attribute |
dimension |
enum KernelDimension |
required |
Coordinate axis to read. |
Examples
%tid = kernel.workitem.id<x> : index