Skip to main content

for_each_chunk

Function for_each_chunk 

Source
pub fn for_each_chunk<T: Send>(
    out: &mut [T],
    work: usize,
    f: impl Fn(usize, &mut [T]) + Sync,
)
Expand description

Run f(start, chunk) over contiguous chunks of out, where start is the index of chunk[0] in out; on the thread pool when work (in f64 operations) is large. Each element must depend only on its own index, so the result does not depend on the chunking.