cubecl_matmul/components/global/write/event.rs
1use cubecl_core as cubecl;
2use cubecl_core::prelude::*;
3use cubecl_std::tensor::layout::Coords2d;
4
5#[derive(CubeType, Debug, Clone, Copy, PartialEq, Eq)]
6/// Events that occur during the process of storing tiles to
7/// a stage and executing writes
8pub enum WriteEvent {
9 /// Before any step
10 Begin,
11 /// After each tile is stored into the stage
12 TileStored { tile: Coords2d },
13 /// After the last step
14 Finish,
15}
16
17#[cube]
18/// Function that is called at each [WriteEvent]
19pub trait WriteEventListener: CubeType {
20 fn on_event(this: &mut Self, event: WriteEvent);
21}