cubecl_matmul/components/global/read/reader/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 StageBuffer {
7 /// First buffer
8 A,
9 /// Second buffer
10 B,
11}
12
13impl StageBuffer {
14 pub fn to_index(&self) -> u32 {
15 match self {
16 StageBuffer::A => 0,
17 StageBuffer::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}