Skip to content

kernel.async.gather

kernel dialect

Initiate a subgroup-collective asynchronous gather from each invocation's source view into a lane-contiguous workgroup destination view. The destination view has one leading subgroup-lane axis and a trailing lane slot with enough static bytes to hold one source payload. If the lane slot is larger than the source footprint, the extra destination bytes are padding bytes with unspecified contents. The destination denotes the subgroup-uniform base tile; the current subgroup lane is applied by the op semantics and must not be pre-applied by forming a lane subview. This directly represents AMDGPU global_load_lds-style staging, including padded narrow loads, without requiring a later pass to rediscover that a set of per-lane copies was really one subgroup LDS DMA operation.

Operation contract

Property Value
Semantic phase
Target contracts kernel.async
Memory effects read source, write dest

Signature

Kind Name Type Cardinality Description
Operand source view required Per-invocation global-like source fragment.
Operand dest view required Subgroup-uniform workgroup destination tile with a leading subgroup-lane axis.
Result token any required Opaque async-copy token for the subgroup gather.
Attribute cache_scope enum CacheScope required Required cache/coherency scope for the transfer.
Attribute cache_temporal enum CacheTemporal required Required temporal cache hint for the transfer.

Examples

%copy = kernel.async.gather %src_lane to %lds_tile {cache_scope = cu, cache_temporal = regular} : view<4xi8> to view<[%wave]x4xi8> -> kernel.async.token
%copy = kernel.async.gather %src_lane to %lds_tile {cache_scope = cu, cache_temporal = regular} : view<12xi8> to view<64x16xi8> -> kernel.async.token