MatmulArgs

Trait MatmulArgs 

Source
pub trait MatmulArgs:
    Send
    + Sync
    + 'static
    + Clone {
    type Input<Lhs: Numeric, Rhs: Numeric, EO: Numeric>: LaunchArg + CubeType;
    type Output<EO: Numeric>: LaunchArg + CubeType;
    type State<Lhs: Numeric, Rhs: Numeric, EO: Numeric>: CubeType;

    // Required methods
    fn init_state<Lhs: Numeric, Rhs: Numeric, EO: Numeric, G: GlobalConfig>(
        input: &Self::Input<Lhs, Rhs, EO>,
        output: &mut Self::Output<EO>,
        config: G,
    ) -> Self::State<Lhs, Rhs, EO>;
    fn __expand_init_state<Lhs: Numeric, Rhs: Numeric, EO: Numeric, G: GlobalConfig>(
        scope: &mut Scope,
        input: <Self::Input<Lhs, Rhs, EO> as CubeType>::ExpandType,
        output: <Self::Output<EO> as CubeType>::ExpandType,
        config: G,
    ) -> <Self::State<Lhs, Rhs, EO> as CubeType>::ExpandType;
    fn __expand_view_lhs<Lhs: Numeric, Rhs: Numeric, EO: Numeric>(
        scope: &mut Scope,
        _state: <Self::State<Lhs, Rhs, EO> as CubeType>::ExpandType,
    ) -> <View<Line<Lhs>, Coords3d> as CubeType>::ExpandType;
    fn __expand_view_rhs<Lhs: Numeric, Rhs: Numeric, EO: Numeric>(
        scope: &mut Scope,
        _state: <Self::State<Lhs, Rhs, EO> as CubeType>::ExpandType,
    ) -> <View<Line<Rhs>, Coords3d> as CubeType>::ExpandType;
    fn __expand_view_acc<Lhs: Numeric, Rhs: Numeric, EO: Numeric>(
        scope: &mut Scope,
        _state: <Self::State<Lhs, Rhs, EO> as CubeType>::ExpandType,
    ) -> <CubeOption<View<Line<EO>, Coords3d>> as CubeType>::ExpandType;
    fn __expand_view_out<Lhs: Numeric, Rhs: Numeric, EO: Numeric>(
        scope: &mut Scope,
        _state: <Self::State<Lhs, Rhs, EO> as CubeType>::ExpandType,
    ) -> <View<Line<EO>, Coords3d, ReadWrite> as CubeType>::ExpandType;

    // Provided methods
    fn view_lhs<Lhs: Numeric, Rhs: Numeric, EO: Numeric>(
        _state: &Self::State<Lhs, Rhs, EO>,
    ) -> View<Line<Lhs>, Coords3d> { ... }
    fn view_rhs<Lhs: Numeric, Rhs: Numeric, EO: Numeric>(
        _state: &Self::State<Lhs, Rhs, EO>,
    ) -> View<Line<Rhs>, Coords3d> { ... }
    fn view_acc<Lhs: Numeric, Rhs: Numeric, EO: Numeric>(
        _state: &Self::State<Lhs, Rhs, EO>,
    ) -> CubeOption<View<Line<EO>, Coords3d>> { ... }
    fn view_out<Lhs: Numeric, Rhs: Numeric, EO: Numeric>(
        _state: &mut Self::State<Lhs, Rhs, EO>,
    ) -> View<Line<EO>, Coords3d, ReadWrite> { ... }
}
Expand description

Arguments for the matrix multiplication algorithm.

Required Associated Types§

Source

type Input<Lhs: Numeric, Rhs: Numeric, EO: Numeric>: LaunchArg + CubeType

Type used for the input.

Source

type Output<EO: Numeric>: LaunchArg + CubeType

Type used for the output.

Source

type State<Lhs: Numeric, Rhs: Numeric, EO: Numeric>: CubeType

Inner state that is used to create tensor inputs and tensor outputs .

Required Methods§

Source

fn init_state<Lhs: Numeric, Rhs: Numeric, EO: Numeric, G: GlobalConfig>( input: &Self::Input<Lhs, Rhs, EO>, output: &mut Self::Output<EO>, config: G, ) -> Self::State<Lhs, Rhs, EO>

Init the state.

Source

fn __expand_init_state<Lhs: Numeric, Rhs: Numeric, EO: Numeric, G: GlobalConfig>( scope: &mut Scope, input: <Self::Input<Lhs, Rhs, EO> as CubeType>::ExpandType, output: <Self::Output<EO> as CubeType>::ExpandType, config: G, ) -> <Self::State<Lhs, Rhs, EO> as CubeType>::ExpandType

Source

fn __expand_view_lhs<Lhs: Numeric, Rhs: Numeric, EO: Numeric>( scope: &mut Scope, _state: <Self::State<Lhs, Rhs, EO> as CubeType>::ExpandType, ) -> <View<Line<Lhs>, Coords3d> as CubeType>::ExpandType

Source

fn __expand_view_rhs<Lhs: Numeric, Rhs: Numeric, EO: Numeric>( scope: &mut Scope, _state: <Self::State<Lhs, Rhs, EO> as CubeType>::ExpandType, ) -> <View<Line<Rhs>, Coords3d> as CubeType>::ExpandType

Source

fn __expand_view_acc<Lhs: Numeric, Rhs: Numeric, EO: Numeric>( scope: &mut Scope, _state: <Self::State<Lhs, Rhs, EO> as CubeType>::ExpandType, ) -> <CubeOption<View<Line<EO>, Coords3d>> as CubeType>::ExpandType

Source

fn __expand_view_out<Lhs: Numeric, Rhs: Numeric, EO: Numeric>( scope: &mut Scope, _state: <Self::State<Lhs, Rhs, EO> as CubeType>::ExpandType, ) -> <View<Line<EO>, Coords3d, ReadWrite> as CubeType>::ExpandType

Provided Methods§

Source

fn view_lhs<Lhs: Numeric, Rhs: Numeric, EO: Numeric>( _state: &Self::State<Lhs, Rhs, EO>, ) -> View<Line<Lhs>, Coords3d>

Source

fn view_rhs<Lhs: Numeric, Rhs: Numeric, EO: Numeric>( _state: &Self::State<Lhs, Rhs, EO>, ) -> View<Line<Rhs>, Coords3d>

Source

fn view_acc<Lhs: Numeric, Rhs: Numeric, EO: Numeric>( _state: &Self::State<Lhs, Rhs, EO>, ) -> CubeOption<View<Line<EO>, Coords3d>>

Source

fn view_out<Lhs: Numeric, Rhs: Numeric, EO: Numeric>( _state: &mut Self::State<Lhs, Rhs, EO>, ) -> View<Line<EO>, Coords3d, ReadWrite>

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§

Source§

impl MatmulArgs for TensorArgs

Source§

type Output<EO: Numeric> = View<Line<EO>, (u32, u32, u32), ReadWrite>

Source§

type Input<Lhs: Numeric, Rhs: Numeric, EO: Numeric> = TensorInputs<Lhs, Rhs, EO>

Source§

type State<Lhs: Numeric, Rhs: Numeric, EO: Numeric> = (View<Line<Lhs>, (u32, u32, u32)>, View<Line<Rhs>, (u32, u32, u32)>, CubeOption<View<Line<EO>, (u32, u32, u32)>>, View<Line<EO>, (u32, u32, u32), ReadWrite>)

Source§

impl MatmulArgs for TensorMapArgs

Source§

type Input<Lhs: Numeric, Rhs: Numeric, EO: Numeric> = TensorMapInputs<Lhs, Rhs, EO>

Source§

type Output<EO: Numeric> = View<Line<EO>, (u32, u32, u32), ReadWrite>

Source§

type State<Lhs: Numeric, Rhs: Numeric, EO: Numeric> = (View<Line<Lhs>, (u32, u32, u32)>, View<Line<Rhs>, (u32, u32, u32)>, CubeOption<View<Line<EO>, (u32, u32, u32)>>, View<Line<EO>, (u32, u32, u32), ReadWrite>)