vyre_foundation/ir_inner/model/program/stats/
methods.rs1use super::{
2 ProgramStats, CAP_ASYNC_DISPATCH, CAP_BF16, CAP_DISTRIBUTED_COLLECTIVES, CAP_F16, CAP_F64,
3 CAP_INDIRECT_DISPATCH, CAP_SUBGROUP_OPS, CAP_TENSOR_OPS, CAP_TRAP, NODE_KIND_ASSIGN,
4 NODE_KIND_BARRIER, NODE_KIND_IF, NODE_KIND_LET, NODE_KIND_LOOP, NODE_KIND_REGION,
5 NODE_KIND_STORE,
6};
7
8impl ProgramStats {
9 #[inline]
11 #[must_use]
12 pub fn subgroup_ops(&self) -> bool {
13 self.capability_bits & CAP_SUBGROUP_OPS != 0
14 }
15
16 #[inline]
18 #[must_use]
19 pub fn f16(&self) -> bool {
20 self.capability_bits & CAP_F16 != 0
21 }
22
23 #[inline]
25 #[must_use]
26 pub fn bf16(&self) -> bool {
27 self.capability_bits & CAP_BF16 != 0
28 }
29
30 #[inline]
32 #[must_use]
33 pub fn f64(&self) -> bool {
34 self.capability_bits & CAP_F64 != 0
35 }
36
37 #[inline]
39 #[must_use]
40 pub fn async_dispatch(&self) -> bool {
41 self.capability_bits & CAP_ASYNC_DISPATCH != 0
42 }
43
44 #[inline]
46 #[must_use]
47 pub fn indirect_dispatch(&self) -> bool {
48 self.capability_bits & CAP_INDIRECT_DISPATCH != 0
49 }
50
51 #[inline]
53 #[must_use]
54 pub fn tensor_ops(&self) -> bool {
55 self.capability_bits & CAP_TENSOR_OPS != 0
56 }
57
58 #[inline]
60 #[must_use]
61 pub fn trap(&self) -> bool {
62 self.capability_bits & CAP_TRAP != 0
63 }
64
65 #[inline]
67 #[must_use]
68 pub fn distributed_collectives(&self) -> bool {
69 self.capability_bits & CAP_DISTRIBUTED_COLLECTIVES != 0
70 }
71
72 #[inline]
83 #[must_use]
84 pub fn has_any_node_kind(&self, mask: u32) -> bool {
85 (self.node_kinds_present & mask) != 0
86 }
87
88 #[inline]
90 #[must_use]
91 pub fn has_node_let(&self) -> bool {
92 self.has_any_node_kind(NODE_KIND_LET)
93 }
94 #[inline]
96 #[must_use]
97 pub fn has_node_loop(&self) -> bool {
98 self.has_any_node_kind(NODE_KIND_LOOP)
99 }
100 #[inline]
102 #[must_use]
103 pub fn has_node_if(&self) -> bool {
104 self.has_any_node_kind(NODE_KIND_IF)
105 }
106 #[inline]
108 #[must_use]
109 pub fn has_node_store(&self) -> bool {
110 self.has_any_node_kind(NODE_KIND_STORE)
111 }
112 #[inline]
114 #[must_use]
115 pub fn has_node_barrier(&self) -> bool {
116 self.has_any_node_kind(NODE_KIND_BARRIER)
117 }
118 #[inline]
120 #[must_use]
121 pub fn has_node_assign(&self) -> bool {
122 self.has_any_node_kind(NODE_KIND_ASSIGN)
123 }
124 #[inline]
126 #[must_use]
127 pub fn has_node_region(&self) -> bool {
128 self.has_any_node_kind(NODE_KIND_REGION)
129 }
130}