cubecl_macros

Derive Macro AutotuneKey

Source
#[derive(AutotuneKey)]
{
    // Attributes available to this derive:
    #[autotune]
}
Expand description

Implements display and initialization for autotune keys.

§Helper

Use the #[autotune] helper attribute to anchor fields to the next power of two, or rename the fields for the display implementation.

§Example

#[derive(AutotuneKey, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub struct OperationKey {
    #[autotune(name = "Batch Size")]
    batch_size: usize,
    channels: usize,
    #[autotune(anchor(max = 1024))]
    height: usize,
    #[autotune(anchor)]
    width: usize,
}