Trait LaunchArgExpand

Source
pub trait LaunchArgExpand: CubeType {
    type CompilationArg: CompilationArg;

    // Required method
    fn expand(
        arg: &Self::CompilationArg,
        builder: &mut KernelBuilder,
    ) -> <Self as CubeType>::ExpandType;

    // Provided method
    fn expand_output(
        arg: &Self::CompilationArg,
        builder: &mut KernelBuilder,
    ) -> <Self as CubeType>::ExpandType { ... }
}
Expand description

Defines how a launch argument can be expanded.

TODO Verify the accuracy of the next comment.

Normally this type should be implemented two times for an argument. Once for the reference and the other for the mutable reference. Often time, the reference should expand the argument as an input while the mutable reference should expand the argument as an output.

Required Associated Types§

Source

type CompilationArg: CompilationArg

Compilation argument.

Required Methods§

Source

fn expand( arg: &Self::CompilationArg, builder: &mut KernelBuilder, ) -> <Self as CubeType>::ExpandType

Register an input variable during compilation that fill the KernelBuilder.

Provided Methods§

Source

fn expand_output( arg: &Self::CompilationArg, builder: &mut KernelBuilder, ) -> <Self as CubeType>::ExpandType

Register an output variable during compilation that fill the KernelBuilder.

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.

Implementations on Foreign Types§

Source§

impl LaunchArgExpand for f32

Source§

impl LaunchArgExpand for f64

Source§

impl LaunchArgExpand for i8

Source§

impl LaunchArgExpand for i16

Source§

impl LaunchArgExpand for i32

Source§

impl LaunchArgExpand for i64

Source§

impl LaunchArgExpand for u8

Source§

impl LaunchArgExpand for u16

Source§

impl LaunchArgExpand for u32

Source§

impl LaunchArgExpand for u64

Source§

impl LaunchArgExpand for ()

Source§

type CompilationArg = ()

Source§

fn expand( _: &Self::CompilationArg, _builder: &mut KernelBuilder, ) -> <Self as CubeType>::ExpandType

Source§

impl LaunchArgExpand for bf16

Source§

impl LaunchArgExpand for f16

Implementors§