Skip to main content

math_op

Function math_op 

Source
fn math_op<'a>(
    name: &str,
    arguments: &'a [Box<Expr>],
) -> Result<Option<(MathOp, &'a Expr)>>
Expand description

The pointwise kernel name denotes over its vector, and that vector, or None when this compiler has no math kernel for that name.

A name that is not in math_signature is not math: the caller reports that it has no kernel instead of compiling it into a kernel that would compute something else. arguments is the call’s whole argument list, because the vector is its first argument: the arity is the signature’s and counts the vector in, so a call with no argument at all is refused as a call that wrote none rather than as a shape this compiler cannot bind. The arguments after the vector are the call’s constants, in the order they were written, and each is folded to the number it means by constant_value, because the tree binds a kernel’s constants and has no field for an expression.