pub struct TunableSet<K: AutotuneKey, F: TuneInputs, Output: 'static> { /* private fields */ }Expand description
A set of candidate tunable functions for autotune, sharing a key generator and an
input generator. See TuneInputs for the F parameter.
Implementations§
Source§impl<K: AutotuneKey, F: TuneInputs, Output: 'static> TunableSet<K, F, Output>
impl<K: AutotuneKey, F: TuneInputs, Output: 'static> TunableSet<K, F, Output>
Sourcepub fn new(
key_gen: impl KeyGenerator<K, F>,
input_gen: impl InputGenerator<K, F>,
) -> Self
pub fn new( key_gen: impl KeyGenerator<K, F>, input_gen: impl InputGenerator<K, F>, ) -> Self
Create a tunable set from a key generator and an input generator.
Sourcepub fn new_cloning_inputs(key_gen: impl KeyGenerator<K, F>) -> Self
pub fn new_cloning_inputs(key_gen: impl KeyGenerator<K, F>) -> Self
Shorthand for new with a [CloneInputGenerator]: benchmarks run
on clones of the real call inputs.
Sourcepub fn with(self, tunable: Tunable<K, F, Output>) -> Self
pub fn with(self, tunable: Tunable<K, F, Output>) -> Self
Register a tunable with this tunable set.
Sourcepub fn with_bounds(
self,
bounds: Arc<dyn BoundsGenerator<K, F, AutotuneBound> + Send + Sync>,
) -> Self
pub fn with_bounds( self, bounds: Arc<dyn BoundsGenerator<K, F, AutotuneBound> + Send + Sync>, ) -> Self
Sets the autotune bounds for this set.
Sourcepub fn autotunables(&self) -> impl Iterator<Item = &TuneFn<F, Output>>
pub fn autotunables(&self) -> impl Iterator<Item = &TuneFn<F, Output>>
All candidate operations in this set, in registration order.
Sourcepub fn fastest(&self, fastest_index: usize) -> &TuneFn<F, Output>
pub fn fastest(&self, fastest_index: usize) -> &TuneFn<F, Output>
Returns the operation for the given index, matching the order returned by
autotunables. Tunables are tried in order, so index 0 should be a good default.
Sourcepub fn compute_checksum(&self) -> String
pub fn compute_checksum(&self) -> String
Compute a checksum that invalidates outdated cached auto-tune results when the set of tunable names changes.
Sourcepub fn generate_key<'a>(&self, inputs: &F::At<'a>) -> K
pub fn generate_key<'a>(&self, inputs: &F::At<'a>) -> K
Generate a key from a set of inputs
Sourcepub fn generate_inputs<'a>(&self, key: &K, inputs: &F::At<'a>) -> F::At<'a>
pub fn generate_inputs<'a>(&self, key: &K, inputs: &F::At<'a>) -> F::At<'a>
Generate a set of test inputs from a key and reference inputs.
Auto Trait Implementations§
impl<K, F, Output> !RefUnwindSafe for TunableSet<K, F, Output>
impl<K, F, Output> !UnwindSafe for TunableSet<K, F, Output>
impl<K, F, Output> Freeze for TunableSet<K, F, Output>
impl<K, F, Output> Send for TunableSet<K, F, Output>
impl<K, F, Output> Sync for TunableSet<K, F, Output>
impl<K, F, Output> Unpin for TunableSet<K, F, Output>
impl<K, F, Output> UnsafeUnpin for TunableSet<K, F, Output>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
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>
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