Skip to main content

vyre_reference/dual_impls/arith/add/
reference.rs

1use crate::{dual_impls::common, workgroup::Memory};
2use vyre_primitives::ArithAdd;
3
4impl common::ReferenceEvaluator for ArithAdd {
5    fn evaluate(&self, inputs: &[Memory]) -> Result<Memory, common::EvalError> {
6        let (left, right) = common::two_inputs(inputs, "arith_add")?;
7        Ok(common::scalar(
8            common::read_u32(left, "arith_add")?
9                .wrapping_add(common::read_u32(right, "arith_add")?),
10        ))
11    }
12}