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 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.