numr 0.5.2

High-performance numerical computing with multi-backend GPU acceleration (CPU/CUDA/WebGPU)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Trait for device identification

/// Trait for device identification
pub trait Device: Clone + Send + Sync + 'static {
    /// Unique identifier for this device
    fn id(&self) -> usize;

    /// Check if two devices are the same
    fn is_same(&self, other: &Self) -> bool {
        self.id() == other.id()
    }

    /// Human-readable name
    fn name(&self) -> String {
        format!("Device({})", self.id())
    }
}