pub struct TunerCache {
pub entries: BTreeMap<String, [u32; 3]>,
}Expand description
Per-adapter tuner decisions keyed by program fingerprint.
Fields§
§entries: BTreeMap<String, [u32; 3]>program_fingerprint -> best_workgroup_size.
Implementations§
Source§impl TunerCache
impl TunerCache
Sourcepub fn get(&self, program_fp: &str) -> Option<[u32; 3]>
pub fn get(&self, program_fp: &str) -> Option<[u32; 3]>
Return the best workgroup size for the given key, if cached.
Sourcepub fn get_key(&self, key: &TunerProgramKey) -> Option<[u32; 3]>
pub fn get_key(&self, key: &TunerProgramKey) -> Option<[u32; 3]>
Return the cached decision for a typed tuner key.
Sourcepub fn set_key(&mut self, key: TunerProgramKey, size: [u32; 3])
pub fn set_key(&mut self, key: TunerProgramKey, size: [u32; 3])
Record a decision under a typed key.
HOT PATH (autotuner cache write): takes ownership of key so the fingerprint String
moves into the map - set(key.as_str(), …) would allocate a second copy of the same bytes.
Trait Implementations§
Source§impl Clone for TunerCache
impl Clone for TunerCache
Source§fn clone(&self) -> TunerCache
fn clone(&self) -> TunerCache
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TunerCache
impl Debug for TunerCache
Source§impl Default for TunerCache
impl Default for TunerCache
Source§fn default() -> TunerCache
fn default() -> TunerCache
Returns the “default value” for a type. Read more
impl Eq for TunerCache
Source§impl PartialEq for TunerCache
impl PartialEq for TunerCache
Source§fn eq(&self, other: &TunerCache) -> bool
fn eq(&self, other: &TunerCache) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for TunerCache
Auto Trait Implementations§
impl Freeze for TunerCache
impl RefUnwindSafe for TunerCache
impl Send for TunerCache
impl Sync for TunerCache
impl Unpin for TunerCache
impl UnsafeUnpin for TunerCache
impl UnwindSafe for TunerCache
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.