cubecl_matmul/components/global/load/loader/shared.rs
1use cubecl_core as cubecl;
2use cubecl_core::prelude::CubeType;
3
4#[derive(Copy, Clone, CubeType)]
5/// Identifier for the stage in global double buffering
6pub enum StageIdent {
7 /// First buffer
8 A,
9 /// Second buffer
10 B,
11}
12
13impl StageIdent {
14 pub fn to_index(&self) -> u32 {
15 match self {
16 StageIdent::A => 0,
17 StageIdent::B => 1,
18 }
19 }
20}
21
22#[derive(CubeType, Clone)]
23/// Comptime counter for loading tasks
24pub struct TaskCounter {
25 #[cube(comptime)]
26 pub counter: u32,
27}