#[non_exhaustive]pub enum SpecValue {
U32(u32),
I32(i32),
F32(f32),
Bool(bool),
DType(DataType),
}Expand description
One specializable scalar attribute value.
Not Copy because the DType(DataType) variant carries a
vyre_spec::DataType whose payload-bearing variants
(Array { element_size }, Vec { .. }, Handle(_)) are not
trivially copyable. Cloning is cheap regardless - the enum is
small and tag-discriminated.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
U32(u32)
Unsigned 32-bit integer.
I32(i32)
Signed 32-bit integer.
F32(f32)
32-bit float, cache-hashed by its bit pattern.
Bool(bool)
Boolean flag.
DType(DataType)
Element data type. ROADMAP F3 - dtype-specialized kernel variants
flow through the same SpecMap cache as tile-size and unroll
choices, so the F1 specialization-cache key already separates
(matmul, F32) from (matmul, F16) without any backend-specific
extension.
Implementations§
Source§impl SpecValue
impl SpecValue
Sourcepub fn as_pipeline_f64(&self) -> f64
pub fn as_pipeline_f64(&self) -> f64
Convert to a lossless scalar form for backends whose override API accepts numeric constants through a common floating-point carrier.
Sourcepub fn cache_hash(&self) -> u64
pub fn cache_hash(&self) -> u64
Hash this value into a 64-bit backend-neutral cache contribution.