Skip to content

kernel.async.copy

kernel dialect

Initiate an asynchronous byte-for-byte transfer between two already originated views. The source and destination view types may use different logical element types or shapes, but they must describe the same static byte footprint. The direction attribute makes the required memory-space flow explicit. The returned token must be committed to exactly one kernel.async.group before the copied bytes are waited or consumed.

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 Typed source view whose base is copied from.
Operand dest view required Typed destination view whose base is copied to.
Result token any required Opaque async-copy token for the initiated copy.
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.
Attribute direction enum KernelAsyncDirection required Required memory-space direction for the transfer.

Examples

%copy = kernel.async.copy %src to %dst {cache_scope = cu, cache_temporal = regular, direction = global_to_workgroup} : view<16xi8> to view<16xi8> -> kernel.async.token