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
use std::fmt::Debug;
use crate::AsmShmemHeader;
#[repr(C)]
#[derive(Debug)]
pub(crate) struct AsmMOHeader {
pub version: u64,
pub exit_code: u64,
pub shmem_allocated_size: u64,
pub shmem_used_size: u64,
pub num_chunks: u64,
}
impl AsmShmemHeader for AsmMOHeader {
fn allocated_size(&self) -> u64 {
self.shmem_allocated_size
}
}
#[repr(C)]
#[derive(Debug)]
pub(crate) struct AsmMOChunk {
pub end: u64,
pub mem_ops_size: u64,
}
/// Type of buffer used on GPU MO count and plan.
#[derive(Clone, Copy, Debug, Default)]
pub enum GpuBufferSource {
/// Execution is finally delegated to the CPU path.
#[default]
Cpu,
/// Uses the provided pil2-proofman prover buffer.
Borrowed {
/// Raw pointer to the buffer.
ptr: usize,
/// Buffer size in bytes.
size: usize,
/// Device the buffer lives on (proofman's my_gpu_ids[0]); not always 0.
gpu_id: u32,
},
/// The buffer is allocated and owned by the runner.
SelfAllocated,
}