pub fn replay_copy_raw<T>(
dest: &mut RawStridedMut<'_, T>,
src: &RawStridedRef<'_, T>,
exec: Exec<'_>,
) -> Result<()>Expand description
dest = src, replaying the axes of the two views exactly as given.
The views carry already-fused dims: no axis is reordered, dropped or
merged, and no plan is compiled. Axis 0 is the inner run. Bounds were validated when the views were built
(RawStridedRef::new, RawStridedMut::new). On a successful call the
replay itself (validation, traversal and dispatch) allocates nothing for a
rank at most RAW_FUSED_RANK_LIMIT; above it, the axis list and the cursor
of each replayed range are stored in rank-sized buffers. An error may
allocate its payload.
The width comes from the repository rule on exec. A parallel replay runs
only on a destination proven injective without allocating; any other
destination is replayed serially in column-major order of the given axes.
§Errors
StridedError::ShapeMismatch when the
two views have different dims, and
StridedError::OffsetOverflow when the
element count overflows usize; both before any write.
§Examples
Copy the outer band 1..3 of a stored 2 x 3 block into a transposed
destination:
use strided_basic::{replay_copy_raw, Exec, RawStridedMut, RawStridedRef};
let stored = [0.0f64, 1.0, 2.0, 3.0, 4.0, 5.0]; // column-major 2 x 3
let band = [2usize, 2];
let src = RawStridedRef::new(&stored, &band, &[1, 2], 2).unwrap();
let mut out = [0.0f64; 4];
let mut dst = RawStridedMut::new(&mut out, &band, &[2, 1], 0).unwrap();
replay_copy_raw(&mut dst, &src, Exec::serial()).unwrap();
assert_eq!(out, [2.0, 4.0, 3.0, 5.0]);