pub enum DataType {
Show 13 variants
U32,
I32,
U64,
Vec2U32,
Vec4U32,
Bool,
Bytes,
Array {
element_size: usize,
},
F16,
BF16,
F32,
F64,
Tensor,
}Expand description
Canonical data types supported by the vyre IR frozen data contract.
Integer-first by design. GPU floating-point is nondeterministic across
vendors through different rounding, fused multiply-add, and subnormal
handling. Integer arithmetic is deterministic everywhere. F32 is supported
for primitives that require it, with conformance validated per-backend.
vyre::ir::DataType re-exports this same type; conformance metadata should
use this canonical contract path. Example: DataType::Vec4U32 records a
four-word lane value and has a minimum byte width of 16.
Variants§
U32
Unsigned 32-bit integer. The fundamental GPU word.
I32
Signed 32-bit integer.
U64
Unsigned 64-bit integer, emulated as vec2<u32> with low and high words.
Vec2U32
Two-component u32 vector.
Vec4U32
Four-component u32 vector.
Bool
Boolean value stored as a GPU word.
Bytes
Variable-length byte buffer.
Array
Fixed-element-size array.
Each element is element_size bytes. The total byte count is
N * element_size where N is encoded by the value.
F16
Strict IEEE 754 binary16 floating-point.
BF16
Strict bfloat16 floating-point.
F32
IEEE 754 binary32 floating-point.
F64
Strict IEEE 754 binary64 floating-point.
Tensor
Multi-dimensional tensor value.
Implementations§
Source§impl DataType
impl DataType
Sourcepub const fn max_bytes(&self) -> Option<usize>
pub const fn max_bytes(&self) -> Option<usize>
Maximum byte count for one value of this type.
Returns None for truly unbounded types; currently all variants
have a hard ceiling. Fixed-width types return Some(min_bytes()).
Sourcepub const fn element_size(&self) -> Option<usize>
pub const fn element_size(&self) -> Option<usize>
Element size for array-typed outputs, or None for scalar types.
Sourcepub const fn is_float_family(&self) -> bool
pub const fn is_float_family(&self) -> bool
Whether this type belongs to the strict floating-point conformance family.