Skip to main content

copy_into_uninit

Function copy_into_uninit 

Source
pub fn copy_into_uninit<T: Copy + Send + Sync + 'static>(
    dest: &mut StridedViewMut<'_, MaybeUninit<T>>,
    src: &StridedView<'_, T>,
    exec: Exec<'_>,
) -> Result<()>
Expand description

Copy elements into an uninitialized destination: dest[i] = src[i].

The same permutation engine as copy_into, selected on T rather than on MaybeUninit<T>: the engine’s native f32/f64 kernels are chosen by element type, so a destination reinterpreted as MaybeUninit<T> would otherwise fall to the generic element path (about 2.5x slower on a 4096x4096 f64 transpose). Every destination element the views describe is written exactly once; the stores go through raw pointers only, so no reference to uninitialized storage is formed.