pub trait Algorithm {
type SelectionArgs: Default + Clone;
type TileMatmul: TileMatmulFamily;
type StageMatmul: StageMatmulFamily;
type GlobalMatmul: GlobalMatmulFamily;
type BatchMatmul: BatchMatmulFamily;
// Required method
fn selection<R: Runtime>(
client: &ComputeClient<R::Server>,
problem: &MatmulProblem,
plane_dim: u32,
line_sizes: &MatmulLineSizes,
elems: MatmulElems,
args: &Self::SelectionArgs,
) -> Result<MatmulSelection, MatmulSetupError>;
// Provided methods
fn setup<MP: MatmulPrecision, R: Runtime>(
client: &ComputeClient<R::Server>,
problem: &MatmulProblem,
selection: &MatmulSelection,
line_sizes: &MatmulLineSizes,
) -> Result<<Self::BatchMatmul as BatchMatmulFamily>::Config, MatmulSetupError> { ... }
fn filter_line_sizes(
available_line_sizes: AvailableLineSizes,
) -> AvailableLineSizes { ... }
fn select_plane_dim<R: Runtime>(client: &ComputeClient<R::Server>) -> u32 { ... }
}Expand description
Specifications for a matmul algorithm
Required Associated Types§
type SelectionArgs: Default + Clone
type TileMatmul: TileMatmulFamily
type StageMatmul: StageMatmulFamily
type GlobalMatmul: GlobalMatmulFamily
type BatchMatmul: BatchMatmulFamily
Required Methods§
fn selection<R: Runtime>( client: &ComputeClient<R::Server>, problem: &MatmulProblem, plane_dim: u32, line_sizes: &MatmulLineSizes, elems: MatmulElems, args: &Self::SelectionArgs, ) -> Result<MatmulSelection, MatmulSetupError>
Provided Methods§
fn setup<MP: MatmulPrecision, R: Runtime>( client: &ComputeClient<R::Server>, problem: &MatmulProblem, selection: &MatmulSelection, line_sizes: &MatmulLineSizes, ) -> Result<<Self::BatchMatmul as BatchMatmulFamily>::Config, MatmulSetupError>
fn filter_line_sizes( available_line_sizes: AvailableLineSizes, ) -> AvailableLineSizes
fn select_plane_dim<R: Runtime>(client: &ComputeClient<R::Server>) -> u32
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.