pub struct WorkGroupConfig {
pub preferred_size: usize,
pub max_size: usize,
pub min_size: usize,
}Expand description
Configuration for choosing optimal work group sizes.
Models GPU-like work group sizing where the total work is divided into groups of a fixed size, potentially with padding in the last group.
Fields§
§preferred_size: usizePreferred work group size (e.g. 64, 128, 256).
max_size: usizeMaximum work group size supported.
min_size: usizeMinimum work group size (avoid groups too small for efficiency).
Implementations§
Source§impl WorkGroupConfig
impl WorkGroupConfig
Sourcepub fn cpu_default() -> Self
pub fn cpu_default() -> Self
Create a default config suitable for CPU-side Rayon parallelism.
Sourcepub fn optimal_size(&self, total: usize) -> usize
pub fn optimal_size(&self, total: usize) -> usize
Compute the optimal work group size for total items.
Returns a size in \[min_size, max_size\] that balances occupancy.
Prefers preferred_size but adjusts if total is small.
Sourcepub fn num_groups(&self, total: usize) -> usize
pub fn num_groups(&self, total: usize) -> usize
Compute the number of work groups needed for total items.
Auto Trait Implementations§
impl Freeze for WorkGroupConfig
impl RefUnwindSafe for WorkGroupConfig
impl Send for WorkGroupConfig
impl Sync for WorkGroupConfig
impl Unpin for WorkGroupConfig
impl UnsafeUnpin for WorkGroupConfig
impl UnwindSafe for WorkGroupConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more