vyre-reference 0.6.2

Pure-Rust CPU reference interpreter for vyre IR; byte-identical oracle for backend conformance
Documentation
1
2
3
4
5
6
7
8
9
10
11
use crate::{dual_impls::common, workgroup::Memory};
use vyre_primitives::hash::fnv1a::fnv1a32;
use vyre_primitives::HashFnv1a;

impl common::ReferenceEvaluator for HashFnv1a {
    fn evaluate(&self, inputs: &[Memory]) -> Result<Memory, common::EvalError> {
        let input = common::one_input(inputs, "hash_fnv1a")?;
        let hash = fnv1a32(&input);
        Ok(Memory::from_bytes(hash.to_le_bytes().to_vec()))
    }
}