Skip to main content

reference_eval

Function reference_eval 

Source
pub fn reference_eval(
    bp: &TensorWasmKernelBlueprint,
    inputs: &[u8],
) -> Result<Vec<u8>, ReferenceEvalError>
Expand description

Interpret a blueprint over inputs (treated as a little-endian f32 stream) and produce the corresponding little-endian f32 output stream. This is the ground truth the proptest harness asserts the GPU path against.

The interpreter mirrors the PTX emitter’s offset accounting in [crate::ptx_emit::lower_body]: every LoadUnified { lanes } reads lanes consecutive f32s from the input cursor; every StoreUnified { lanes } writes lanes consecutive f32s to the output cursor; arithmetic ops pop two (or three for FMA) values from the value stack and push one result per lane.