Skip to main content

rustyhdf5_gpu/
device.rs

1/// Information about a GPU device.
2#[derive(Debug, Clone)]
3pub struct DeviceInfo {
4    pub name: String,
5    pub backend: String,
6    pub device_type: String,
7    pub max_buffer_size: u64,
8    pub max_storage_buffer_binding_size: u32,
9}
10
11impl std::fmt::Display for DeviceInfo {
12    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13        write!(
14            f,
15            "{} ({}, {}, max buffer {} MB, max binding {} MB)",
16            self.name,
17            self.backend,
18            self.device_type,
19            self.max_buffer_size / (1024 * 1024),
20            self.max_storage_buffer_binding_size / (1024 * 1024),
21        )
22    }
23}