pub struct WorkgroupPlanner;Expand description
Compute optimal workgroup size and dispatch dimensions.
Implementations§
Source§impl WorkgroupPlanner
impl WorkgroupPlanner
Sourcepub fn plan_1d(
total_elements: u32,
strategy: WorkgroupStrategy,
) -> (WorkgroupSize, DispatchDimensions)
pub fn plan_1d( total_elements: u32, strategy: WorkgroupStrategy, ) -> (WorkgroupSize, DispatchDimensions)
Compute 1D dispatch dimensions for a linear problem.
Returns (workgroup_size, dispatch_dims).
Sourcepub fn plan_2d(
width: u32,
height: u32,
strategy: WorkgroupStrategy,
) -> (WorkgroupSize, DispatchDimensions)
pub fn plan_2d( width: u32, height: u32, strategy: WorkgroupStrategy, ) -> (WorkgroupSize, DispatchDimensions)
Compute 2D dispatch dimensions for an image-like problem.
Returns (workgroup_size, dispatch_dims).
Sourcepub fn plan_3d(
width: u32,
height: u32,
depth: u32,
) -> (WorkgroupSize, DispatchDimensions)
pub fn plan_3d( width: u32, height: u32, depth: u32, ) -> (WorkgroupSize, DispatchDimensions)
Compute 3D dispatch dimensions.
Returns (workgroup_size, dispatch_dims).
Sourcepub fn efficiency(
problem_size: (u32, u32),
workgroup: &WorkgroupSize,
dispatch: &DispatchDimensions,
) -> f64
pub fn efficiency( problem_size: (u32, u32), workgroup: &WorkgroupSize, dispatch: &DispatchDimensions, ) -> f64
Estimate efficiency ratio of a dispatch (useful work / total work).
Auto Trait Implementations§
impl Freeze for WorkgroupPlanner
impl RefUnwindSafe for WorkgroupPlanner
impl Send for WorkgroupPlanner
impl Sync for WorkgroupPlanner
impl Unpin for WorkgroupPlanner
impl UnsafeUnpin for WorkgroupPlanner
impl UnwindSafe for WorkgroupPlanner
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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