pub struct WorkgroupAutoTuner { /* private fields */ }Expand description
Auto-tuner that selects optimal workgroup sizes based on device limits.
Implementations§
Source§impl WorkgroupAutoTuner
impl WorkgroupAutoTuner
Sourcepub fn new(limits: DeviceLimits) -> Self
pub fn new(limits: DeviceLimits) -> Self
Create a new auto-tuner with the given device limits.
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
Create a new auto-tuner with default limits.
Sourcepub fn limits(&self) -> &DeviceLimits
pub fn limits(&self) -> &DeviceLimits
Get the device limits.
Sourcepub fn tune_1d(
&self,
total_elements: u32,
) -> (WorkgroupSize, DispatchDimensions)
pub fn tune_1d( &self, total_elements: u32, ) -> (WorkgroupSize, DispatchDimensions)
Auto-tune a 1D workgroup size for a linear problem.
Picks the largest warp-aligned size that fits within device limits.
Sourcepub fn tune_2d(
&self,
width: u32,
height: u32,
) -> (WorkgroupSize, DispatchDimensions)
pub fn tune_2d( &self, width: u32, height: u32, ) -> (WorkgroupSize, DispatchDimensions)
Auto-tune a 2D workgroup size for an image-like problem.
Balances squareness with warp alignment and device limits.
Auto-tune for a 2D problem with shared memory requirements.
Takes into account the per-pixel shared memory usage and ensures the workgroup’s shared memory fits within device limits.
Sourcepub fn estimate_efficiency(
&self,
problem_width: u32,
problem_height: u32,
workgroup: &WorkgroupSize,
) -> f64
pub fn estimate_efficiency( &self, problem_width: u32, problem_height: u32, workgroup: &WorkgroupSize, ) -> f64
Estimate the efficiency of a given configuration.
Auto Trait Implementations§
impl Freeze for WorkgroupAutoTuner
impl RefUnwindSafe for WorkgroupAutoTuner
impl Send for WorkgroupAutoTuner
impl Sync for WorkgroupAutoTuner
impl Unpin for WorkgroupAutoTuner
impl UnsafeUnpin for WorkgroupAutoTuner
impl UnwindSafe for WorkgroupAutoTuner
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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