Skip to main content

impl_vecmap

Macro impl_vecmap 

Source
macro_rules! impl_vecmap {
    ($name:ident, $name_to:ident, $name_elem:ident, $expr:expr) => { ... };
}
Expand description

Generates a mapping kernel in three variants:

  1. $name_to - Zero-allocation canonical implementation, writes to caller’s buffer
  2. $name - Allocates internally, delegates to $name_to
  3. $name_elem - Element-wise fn(f64) -> f64 for kernel fusion

The _to variant is for pre-allocated parallel execution where each chunk writes directly to its slice of a shared output buffer.

The _elem variant is for kernel fusion where multiple operations are composed into a single loop, keeping intermediate values in registers instead of memory.

$name – allocating function name $name_to – zero-allocation function name $name_elem – element-wise function for fusion $expr – expression mapping a scalar f64 -> f64