Skip to main content

Routine

Trait Routine 

Source
pub trait Routine {
    type Blueprint: Blueprint;
    type Strategy: Default + Display + Clone;
    type MatmulRoutine: MatmulRoutine<RuntimeArgs, Blueprint = Self::Blueprint, Strategy = Self::Strategy>;
    type Args: MatmulArgs<Config = RuntimeArgs>;

    const IS_SPECIALIZED: bool = false;

    // Required method
    fn correct_layout<R: Runtime>(
        client: &ComputeClient<R>,
        handle: TensorBinding<R>,
        dtype: StorageType,
        operation: ConvolutionOperation,
    ) -> Result<TensorBinding<R>, LaunchError>;

    // Provided method
    fn filter_vector_sizes(
        vector_sizes: AvailableVectorSizes,
    ) -> AvailableVectorSizes { ... }
}
Expand description

Specifications for a convolution routine.

A Routine is the convolution-side counterpart of cubek_matmul::routines::Routine: it pairs a per-operation matmul routine with the metadata needed to wire the kernel up (input args, optional layout fixups, vector-size filtering).

Blueprint and Strategy are surfaced as direct associated types so callers don’t have to reach through MatmulRoutine to bound them.

Provided Associated Constants§

Source

const IS_SPECIALIZED: bool = false

Whether to select specialized load flow in tests. Should replace with something cleaner eventually, but this is nice and simple.

Required Associated Types§

Required Methods§

Provided Methods§

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§