Trait Algorithm

Source
pub trait Algorithm {
    type TileMatmul: TileMatmulFamily;
    type StageMatmul: StageMatmulFamily<Input = StageInput>;
    type GlobalConvolution: ConvolutionFamily<Input = StageInput>;
    type Args: MatmulArgs;

    // Required methods
    fn cube_dim(selection: &MatmulSelection) -> CubeDim;
    fn cube_count(
        selection: &MatmulSelection,
        problem: &ConvolutionProblem,
    ) -> CubeCount;
    fn into_tensor_handle<R: Runtime, E: Numeric>(
        client: &ComputeClient<R::Server, R::Channel>,
        handle: &TensorHandleRef<'_, R>,
        ident: InputIdent,
    ) -> TensorHandle<R, E>;

    // Provided methods
    fn make_config(
        input: <Self::GlobalConvolution as ConvolutionConfigFactory>::Input,
        problem: &ConvolutionProblem,
        cube_dim: &CubeDim,
        cube_count: &CubeCount,
    ) -> Result<<Self::GlobalConvolution as ConvolutionConfigFactory>::Config, InvalidConfigError> { ... }
    fn check_availability<R: Runtime, MP: MatmulPrecision>(
        client: &ComputeClient<R::Server, R::Channel>,
        config: &<Self::GlobalConvolution as ConvolutionConfigFactory>::Config,
    ) -> Result<(), MatmulAvailabilityError> { ... }
}
Expand description

Specifications for a convolution algorithm

Required Associated Types§

Required Methods§

Source

fn cube_dim(selection: &MatmulSelection) -> CubeDim

Source

fn cube_count( selection: &MatmulSelection, problem: &ConvolutionProblem, ) -> CubeCount

Source

fn into_tensor_handle<R: Runtime, E: Numeric>( client: &ComputeClient<R::Server, R::Channel>, handle: &TensorHandleRef<'_, R>, ident: InputIdent, ) -> TensorHandle<R, E>

Provided Methods§

Source

fn make_config( input: <Self::GlobalConvolution as ConvolutionConfigFactory>::Input, problem: &ConvolutionProblem, cube_dim: &CubeDim, cube_count: &CubeCount, ) -> Result<<Self::GlobalConvolution as ConvolutionConfigFactory>::Config, InvalidConfigError>

Make a convolution config from a convolution problem, and launch options

Source

fn check_availability<R: Runtime, MP: MatmulPrecision>( client: &ComputeClient<R::Server, R::Channel>, config: &<Self::GlobalConvolution as ConvolutionConfigFactory>::Config, ) -> Result<(), MatmulAvailabilityError>

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§