Skip to main content

KernelOps

Trait KernelOps 

Source
pub trait KernelOps: Send + Sync {
    // Required method
    fn backend_name(&self) -> &str;

    // Provided methods
    fn norm_ops(&self) -> Option<&dyn NormOps> { ... }
    fn position_ops(&self) -> Option<&dyn PositionOps> { ... }
    fn attention_ops(&self) -> Option<&dyn AttentionOps> { ... }
    fn activation_ops(&self) -> Option<&dyn ActivationOps> { ... }
    fn linear_ops(&self) -> Option<&dyn LinearOps> { ... }
    fn sampling_ops(&self) -> Option<&dyn SamplingOps> { ... }
}
Expand description

Unified kernel operations interface.

Backends implement whichever sub-traits they support and return None for the rest. Callers use KernelOpsDispatch (below) to get automatic fallback to TensorOps when a sub-trait is unavailable.

Required Methods§

Source

fn backend_name(&self) -> &str

Human-readable backend identifier (e.g. "candle", "metal", "cuda").

Provided Methods§

Implementors§