1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//! Reusable host scratch for direct-resident IFDS CSR preparation.
/// Host-side buffers reused while packing direct-resident IFDS CSR inputs.
#[derive(Clone, Debug, Default, PartialEq)]
pub struct DirectResidentIfdsPrepareScratch {
/// Intra edge procedure ids.
pub intra_proc: Vec<u32>,
/// Intra edge source block ids.
pub intra_src_block: Vec<u32>,
/// Intra edge destination block ids.
pub intra_dst_block: Vec<u32>,
/// Inter edge source procedure ids.
pub inter_src_proc: Vec<u32>,
/// Inter edge source block ids.
pub inter_src_block: Vec<u32>,
/// Inter edge destination procedure ids.
pub inter_dst_proc: Vec<u32>,
/// Inter edge destination block ids.
pub inter_dst_block: Vec<u32>,
/// GEN procedure ids.
pub gen_proc: Vec<u32>,
/// GEN block ids.
pub gen_block: Vec<u32>,
/// GEN fact ids.
pub gen_fact: Vec<u32>,
/// KILL procedure ids.
pub kill_proc: Vec<u32>,
/// KILL block ids.
pub kill_block: Vec<u32>,
/// KILL fact ids.
pub kill_fact: Vec<u32>,
/// Packed byte staging for all CSR-builder inputs.
pub input_bytes: Vec<Vec<u8>>,
/// Packed zero staging for generated resident CSR buffers.
pub generated_zero_bytes: Vec<Vec<u8>>,
}
impl DirectResidentIfdsPrepareScratch {
/// Clear all logical data while retaining capacities for the next prepare.
pub fn clear_for_prepare(&mut self) {
self.intra_proc.clear();
self.intra_src_block.clear();
self.intra_dst_block.clear();
self.inter_src_proc.clear();
self.inter_src_block.clear();
self.inter_dst_proc.clear();
self.inter_dst_block.clear();
self.gen_proc.clear();
self.gen_block.clear();
self.gen_fact.clear();
self.kill_proc.clear();
self.kill_block.clear();
self.kill_fact.clear();
for bytes in &mut self.input_bytes {
bytes.clear();
}
for bytes in &mut self.generated_zero_bytes {
bytes.clear();
}
}
}