pub struct CachedDispatcher { /* private fields */ }Expand description
Cached kernel dispatcher — singleton per process.
Returns Arc<dyn QuantKernel> instead of Box<dyn QuantKernel>,
allowing zero-allocation kernel lookup after the first call for each type.
Implementations§
Source§impl CachedDispatcher
impl CachedDispatcher
Sourcepub fn get_kernel(
&self,
tensor_type: GgufTensorType,
) -> QuantResult<Arc<dyn QuantKernel>>
pub fn get_kernel( &self, tensor_type: GgufTensorType, ) -> QuantResult<Arc<dyn QuantKernel>>
Get or create a cached kernel for the given tensor type.
The first call for each type allocates; subsequent calls return
a clone of the Arc (cheap reference count bump).
Sourcepub fn capabilities(&self) -> &SimdCapabilities
pub fn capabilities(&self) -> &SimdCapabilities
Access the underlying capabilities.
Sourcepub fn is_supported(&self, tensor_type: GgufTensorType) -> bool
pub fn is_supported(&self, tensor_type: GgufTensorType) -> bool
Check if a type is supported (delegates to inner).
Sourcepub fn supported_types(&self) -> Vec<GgufTensorType>
pub fn supported_types(&self) -> Vec<GgufTensorType>
List supported types (delegates to inner).
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for CachedDispatcher
impl RefUnwindSafe for CachedDispatcher
impl Send for CachedDispatcher
impl Sync for CachedDispatcher
impl Unpin for CachedDispatcher
impl UnsafeUnpin for CachedDispatcher
impl UnwindSafe for CachedDispatcher
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> 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>
Converts
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>
Converts
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