cubek_std/cube_count/hypercube/cube_count/strategy.rs
1use crate::cube_count::SmAllocation;
2
3#[derive(Default, Copy, Clone, Debug, Hash, PartialEq, Eq)]
4/// Front-facing configuration when crafting a TilingBlueprint
5/// Allows choosing a strategy before knowing actual values
6pub enum CubeCountStrategy {
7 #[default]
8 /// X: num cubes in m, Y: num cubes in n, Z: num cubes in batch
9 FromProblem,
10
11 /// If not cubes_first: X: num SMs, Y: num cubes per SM
12 /// If cubes_first: X: num cubes per SM, Y: num SMs
13 Sm {
14 cubes_first: bool,
15 num_sms: u32,
16 sm_usage: SmAllocation,
17 },
18
19 /// X: total cubes flattened (num SMs * num cubes per SM)
20 Flattened,
21
22 /// Heuristically find a balance for X, Y, Z that respects hardware limits
23 Spread,
24}