Skip to main content

fused_elementwise_into

Function fused_elementwise_into 

Source
pub fn fused_elementwise_into<T: FusedScalar>(
    dests: &mut [StridedViewMut<'_, T>],
    inputs: &[StridedView<'_, T>],
    plan: &FusedPlan,
) -> Result<()>
Expand description

Evaluate a runtime-DAG elementwise plan into one or more destinations.

The plan is validated before any destination is written:

  • inputs.len() must equal plan.input_count;
  • dests.len() must equal plan.outputs.len();
  • instruction operands must reference earlier SSA values with the right arity for their FusedOp;
  • every input and destination must have exactly the destination shape;
  • each mutable destination layout must be injective, so two logical output elements never map to the same memory address.

The implementation dispatches known single-output plans to existing static map_into/zip_map*_into kernels and uses a generic interpreter fallback for arbitrary validated DAGs. Overlapping source/destination memory is not supported by the strided kernels generally.

Real Maximum, Minimum, and Clamp use Rust f32/f64 max/min semantics. Complex Abs returns the norm in the real component; complex Maximum, Minimum, and Clamp compare by squared norm.