pub struct FftExecutionCache<'a> { /* private fields */ }Expand description
Execution-cache state supplied to an FftBackend.
Direct repeated calls use a caller-owned FftPlanCache, while traced
and eager execution use the executing engine’s own ExtensionCacheStore
(lent by the runtime for the run). The two differ in what they may hold:
- a caller-owned cache may outlive the engine and be used with several engines, so it holds only engine-independent plans (the CPU’s rustfft plans);
- an engine-owned store dies with its engine, so a device backend keeps device-bound plans and workspaces (cuFFT plans) only there. Given a caller-owned cache, a device backend keeps its device-bound plans in its own engine instead.
Constructors keep the owner representation closed.
§Examples
use tenferro_fft::{FftExecutionCache, FftPlanCache};
let mut plans = FftPlanCache::default();
let cache = FftExecutionCache::caller_owned(&mut plans);
assert!(format!("{cache:?}").contains("CallerOwned"));Implementations§
Source§impl<'a> FftExecutionCache<'a>
impl<'a> FftExecutionCache<'a>
Sourcepub fn caller_owned(cache: &'a mut FftPlanCache) -> Self
pub fn caller_owned(cache: &'a mut FftPlanCache) -> Self
Build a context backed by a caller-owned typed FFT execution cache.
Sourcepub fn engine_owned(cache: &'a mut ExtensionCacheStore) -> Self
pub fn engine_owned(cache: &'a mut ExtensionCacheStore) -> Self
Build a context backed by the executing engine’s own extension cache store, which may hold device-bound plans.
§Examples
use tenferro_fft::FftExecutionCache;
use tenferro_runtime::ExtensionCacheStore;
let mut store = ExtensionCacheStore::default();
let cache = FftExecutionCache::engine_owned(&mut store);
assert!(cache.is_engine_owned());Sourcepub fn is_engine_owned(&self) -> bool
pub fn is_engine_owned(&self) -> bool
Whether this store belongs to the executing engine, so device-bound entries may be retained in it.
§Examples
use tenferro_fft::{FftExecutionCache, FftPlanCache};
let mut plans = FftPlanCache::default();
assert!(!FftExecutionCache::caller_owned(&mut plans).is_engine_owned());Sourcepub fn store_mut(&mut self) -> &mut ExtensionCacheStore
pub fn store_mut(&mut self) -> &mut ExtensionCacheStore
Borrow the bounded typed store owned by the caller or extension runtime.
Backend implementations should use a stable family/cache namespace and include every plan-identity field in the key discriminator. The store owns LRU bounds, typed retrieval, clear behavior, entry counts, and the retained-byte estimates supplied at insertion.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for FftExecutionCache<'a>
impl<'a> !UnwindSafe for FftExecutionCache<'a>
impl<'a> Freeze for FftExecutionCache<'a>
impl<'a> Send for FftExecutionCache<'a>
impl<'a> Sync for FftExecutionCache<'a>
impl<'a> Unpin for FftExecutionCache<'a>
impl<'a> UnsafeUnpin for FftExecutionCache<'a>
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<T, U> Imply<T> for U
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