oxirs_vec/gpu/
types.rs

1//! Common GPU types and structures
2
3/// GPU device information
4#[derive(Debug, Clone)]
5pub struct GpuDevice {
6    pub device_id: i32,
7    pub name: String,
8    pub compute_capability: (i32, i32),
9    pub total_memory: usize,
10    pub free_memory: usize,
11    pub max_threads_per_block: i32,
12    pub max_blocks_per_grid: i32,
13    pub warp_size: i32,
14    pub memory_bandwidth: f32,
15    pub peak_flops: f64,
16}
17
18/// GPU execution configuration
19#[derive(Debug, Clone)]
20pub struct GpuExecutionConfig {
21    pub block_size: u32,
22    pub grid_size: u32,
23    pub shared_memory_size: u32,
24    pub stream_id: Option<u32>,
25}
26
27impl Default for GpuExecutionConfig {
28    fn default() -> Self {
29        Self {
30            block_size: 256,
31            grid_size: 256,
32            shared_memory_size: 0,
33            stream_id: None,
34        }
35    }
36}