Skip to main content

LocalTuner

Struct LocalTuner 

Source
pub struct LocalTuner<AK: AutotuneKey, ID> { /* private fields */ }
Expand description

A local tuner allows to create a tuner for a specific key that can be different from the server key.

Implementations§

Source§

impl<AK, ID> LocalTuner<AK, ID>
where AK: AutotuneKey + 'static, ID: Hash + PartialEq + Eq + Clone + Display,

Source

pub const fn new(name: &'static str) -> Self

Create a new local tuner.

Source

pub fn init<I, Out, F>(&self, init_set: F) -> Arc<TunableSet<AK, I, Out>>
where F: Fn() -> TunableSet<AK, I, Out> + 'static + Send + Sync, I: TuneInputs, Out: AutotuneOutput,

Get or initialize the TunableSet for this tuner.

Returns a cached Arc<TunableSet> keyed by the TypeId of init_set. The initializer runs at most once per process.

Source

pub fn clear(&self)

Clear the autotune state.

Source

pub fn execute<'a, R: Runtime, I: TuneInputs, Out>( &self, id: &ID, client: &ComputeClient<R>, operations: Arc<TunableSet<AK, I, Out>>, inputs: <I as TuneInputs>::At<'a>, ) -> Out
where <I as TuneInputs>::At<'a>: Clone + Send, Out: AutotuneOutput,

Execute the fastest operation in a TunableSet, triggering a tuning pass on the first call for a given key.

Auto Trait Implementations§

§

impl<AK, ID> !Freeze for LocalTuner<AK, ID>

§

impl<AK, ID> !RefUnwindSafe for LocalTuner<AK, ID>

§

impl<AK, ID> Send for LocalTuner<AK, ID>
where ID: Send,

§

impl<AK, ID> Sync for LocalTuner<AK, ID>
where ID: Send,

§

impl<AK, ID> Unpin for LocalTuner<AK, ID>
where ID: Unpin,

§

impl<AK, ID> UnsafeUnpin for LocalTuner<AK, ID>

§

impl<AK, ID> !UnwindSafe for LocalTuner<AK, ID>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.