tenrso_exec/hints.rs
1//! Execution hints and configuration
2
3/// Mask specification (placeholder)
4#[derive(Clone, Debug)]
5pub struct MaskPack {
6 // TODO: Implement mask storage
7}
8
9/// Subset specification (placeholder)
10#[derive(Clone, Debug)]
11pub struct SubsetSpec {
12 // TODO: Implement subset/index-list storage
13}
14
15/// Execution hints for controlling tensor operations
16#[derive(Clone, Debug, Default)]
17pub struct ExecHints {
18 /// Optional mask for masked operations
19 pub mask: Option<MaskPack>,
20 /// Optional subset specification
21 pub subset: Option<SubsetSpec>,
22 /// Prefer sparse representation
23 pub prefer_sparse: bool,
24 /// Prefer low-rank representation
25 pub prefer_lowrank: bool,
26 /// Tile size in KB
27 pub tile_kb: Option<usize>,
28}
29
30impl ExecHints {
31 /// Create new execution hints with defaults
32 pub fn new() -> Self {
33 Self::default()
34 }
35
36 /// Set sparse preference
37 pub fn with_sparse(mut self, prefer: bool) -> Self {
38 self.prefer_sparse = prefer;
39 self
40 }
41
42 /// Set low-rank preference
43 pub fn with_lowrank(mut self, prefer: bool) -> Self {
44 self.prefer_lowrank = prefer;
45 self
46 }
47
48 /// Set tile size
49 pub fn with_tile_kb(mut self, kb: usize) -> Self {
50 self.tile_kb = Some(kb);
51 self
52 }
53}