Skip to content

buffer.view

← buffer dialect

Form a typed non-owning view from an opaque buffer origin and byte displacement. A signed index permits positions before a supplied interior origin; an offset remains nonnegative. Forming a view does not access memory or enlarge the buffer's accessible storage. Every eventual access must remain within that storage. The result view type carries the address layout.

Operation contract

Property Value
Semantic phase executable
Traits Pure, RefinableResultTypeRefs

Signature

Kind Name Type Cardinality Description
Operand buffer buffer required Opaque storage root.
Operand byte_offset address required Byte displacement from the buffer origin: signed index or nonnegative offset.
Result result view required Typed logical view over the buffer.

Examples

%view = buffer.view %buffer[%offset] : buffer -> view<[%M]xf32, %layout>