Skip to main content

elementwise_add

Function elementwise_add 

Source
pub fn elementwise_add(
    encoder: &mut CommandEncoder,
    registry: &mut KernelRegistry,
    device: &DeviceRef,
    a: &MlxBuffer,
    b: &MlxBuffer,
    output: &MlxBuffer,
    n_elements: usize,
    dtype: DType,
) -> Result<()>
Expand description

Encode elementwise addition: output = a + b.

Both inputs and output must have the same dtype (F32 or F16).