pub trait LaunchArg: CubeType + 'static {
type RuntimeArg<R: Runtime>: Send + Sync;
type CompilationArg: CompilationArg;
// Required methods
fn register<R: Runtime>(
arg: Self::RuntimeArg<R>,
launcher: &mut KernelLauncher<R>,
) -> Self::CompilationArg;
fn expand(
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 RuntimeArg<R: Runtime>: Send + Sync
type RuntimeArg<R: Runtime>: Send + Sync
The runtime argument for the kernel.
Sourcetype CompilationArg: CompilationArg
type CompilationArg: CompilationArg
Compilation argument.
Required Methods§
fn register<R: Runtime>( arg: Self::RuntimeArg<R>, launcher: &mut KernelLauncher<R>, ) -> Self::CompilationArg
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 a 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".