pub fn erased_map_into(
input_dtype: KernelDType,
op: ErasedMapOp,
dest: &mut ErasedRawStridedMut<'_>,
input: &ErasedRawStridedPtr<'_>,
exec: Exec<'_>,
) -> Result<()>Expand description
Apply one runtime-selected unary operation without compiling a plan.
The destination must not overlap the input. Real and complex dtypes support
every ErasedMapOp, signed integers use wrapping negate/abs semantics,
and bool supports only ErasedMapOp::Conj. Complex absolute value has
the real output contract c32 -> f32 and c64 -> f64; all other supported
unary operations preserve dtype.
ยงErrors
Returns StridedError::DTypeMismatch when input or dest does not
carry the dtype that input_dtype and op imply,
StridedError::UnsupportedOp for a bool input with any op other than
ErasedMapOp::Conj, StridedError::OverlappingInputOutput when the
input allocation overlaps the destination,
StridedError::InvalidBoolByte when a bool input holds a byte other
than 0 or 1, StridedError::NonInjectiveOutputLayout when the
destination layout cannot be proven to place logical elements on distinct
offsets, and StridedError::RankMismatch or
StridedError::ShapeMismatch when the destination dims differ from the
input dims. Validation completes before any write.