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
46
47
// SPDX-License-Identifier: AGPL-3.0-or-later
//! Core device type — minimal enum for routing and capability modules.
//!
//! Extracted from unified.rs to avoid circular dependencies. The full `Device`
//! API (info, `select_for_workload`, etc.) lives in `unified.rs`.
use std::fmt;
/// Unified device abstraction — hardware type only.
///
/// Full construction and capability logic lives in `unified` and `capabilities`.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum Device {
/// CPU execution (pure Rust)
CPU,
/// GPU execution (WGSL via wgpu)
GPU,
/// NPU execution (Akida neuromorphic)
NPU,
/// TPU execution (Tensor Processing Unit)
TPU,
/// Sovereign GPU execution (WGSL → coralReef → native SASS/GFX → DRM).
///
/// Bypasses wgpu/Vulkan/Metal entirely. Requires the `sovereign-dispatch`
/// feature and a coralReef-compatible GPU (NVIDIA SM70+, AMD RDNA2+).
Sovereign,
/// Automatic selection based on workload
Auto,
}
impl fmt::Display for Device {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::CPU => write!(f, "CPU"),
Self::GPU => write!(f, "GPU"),
Self::NPU => write!(f, "NPU"),
Self::TPU => write!(f, "TPU"),
Self::Sovereign => write!(f, "Sovereign"),
Self::Auto => write!(f, "Auto"),
}
}
}