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§
Sourcetype CompilationArg: CompilationArg
type CompilationArg: CompilationArg
Compilation argument.
Required Methods§
Sourcefn expand(
arg: &Self::CompilationArg,
builder: &mut KernelBuilder,
) -> <Self as CubeType>::ExpandType
fn expand( arg: &Self::CompilationArg, builder: &mut KernelBuilder, ) -> <Self as CubeType>::ExpandType
Register an input variable during compilation that fill the KernelBuilder.
Provided Methods§
Sourcefn expand_output(
arg: &Self::CompilationArg,
builder: &mut KernelBuilder,
) -> <Self as CubeType>::ExpandType
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.