mcl_rs/
device.rs

1use libmcl_sys::MCL_DEV_DIMS;
2
3pub const DEV_DIMS: u32 = MCL_DEV_DIMS;
4#[allow(unused_imports)]
5use std::ffi::CString;
6
7#[derive(Clone, Copy, serde::Serialize, serde::Deserialize)]
8pub enum DevType {
9    NONE,
10    CPU,
11    GPU,
12    FPGA,
13    DFT,
14    ANY,
15}
16
17#[derive(Debug)]
18/// Represents info of the computing device
19pub struct DevInfo {
20    /// Device ID
21    pub id: u64,
22    /// Device name
23    pub name: String,
24    /// Device vendor
25    pub vendor: String,
26    /// Device class 0: None, 1: CPU, 2: GPU
27    pub class: u64,
28    /// Device status
29    pub status: u64,
30    /// Device total amount of memory available
31    pub mem_size: u64,
32    /// Device number of processing elements (PEs)
33    pub pes: u64,
34    /// Device number of dimensions
35    pub ndims: u64,
36    /// Device workgroup max size
37    pub wgsize: u64,
38    /// Device max size per dimension
39    pub wisize: Vec<usize>,
40}