pub struct Decl {
pub name: String,
pub binding: u32,
pub role: BufferRole,
pub elem: ElementKind,
pub len: u32,
pub private: bool,
pub atomic: bool,
pub spec_local: Option<u32>,
pub len_spec: Option<String>,
}Expand description
A buffer or shared array the prologue declares.
Fields§
§name: StringThe identifier the body uses (b0, a0).
binding: u32The binding slot of a buffer; unused for a shared array.
role: BufferRoleThe access of a buffer; ReadWrite for a shared array.
elem: ElementKindThe element type: the compute dtype, except in a float kernel, whose buffers may also hold
the other float width and the 32-bit integers a Cast converts.
len: u32The element count of a shared array; 0 for a buffer.
private: booltrue for a per-thread (Private) array, false for a buffer or a workgroup array.
atomic: booltrue when the dialect types atomics (Dialect::typed_atomics) and the kernel applies an
atomic to this buffer or array: every access to it is then an atomic one.
spec_local: Option<u32>For a scalar parameter lowered as a specialization constant (SpecId = binding): the local
that reads it. None for a buffer or an array.
len_spec: Option<String>For an array whose extent is a scalar parameter: the identifier of that specialization
constant (len is then 0).