Skip to main content

ChunkOffsets

Type Alias ChunkOffsets 

Source
pub type ChunkOffsets = ChunkOffsetsBase<Box<[usize]>>;

Aliased Type§

pub struct ChunkOffsets { /* private fields */ }

Implementations§

Source§

impl ChunkOffsets

Source

pub fn partition( dim: NonZeroUsize, num_chunks: NonZeroUsize, ) -> Result<Self, PartitionError>

Build a chunk-offset plan that partitions dim into num_chunks near-equal chunks. The first dim.get() % num_chunks.get() chunks are one element larger than the rest.

Returns an error if the requested partition is not valid (e.g. num_chunks.get() > dim.get()).