cube

Attribute Macro cube 

Source
#[cube]
Expand description

Mark a cube function, trait or implementation for expansion.

§Arguments

  • launch - generates a function to launch the kernel
  • launch_unchecked - generates a launch function without checks
  • debug - panics after generation to print the output to console
  • create_dummy_kernel - Generates a function to create a kernel without launching it. Used for testing.

§Trait arguments

  • expand_base_traits - base traits for the expanded “second half” of a trait with methods.
  • self_type - the type used for the self parameter of the expanded “second half” of a trait with methods. You shouldn’t need to touch this unless you specifically need to dynamically dispatch an expanded trait.

§Example

# use cubecl_macros::cube;
#[cube]
fn my_addition(a: u32, b: u32) -> u32 {
    a + b
}