pub fn resolve_device(spec: &str) -> Result<Device, DeviceError>Expand description
Resolve a CLI --device string into a concrete Device.
Contract: this function is THE single binding point for INV-GPUTRAIN-001 (grammar) and GATE-GPUTRAIN-002 (no silent CPU fallback on explicit CUDA request).
§Errors
DeviceError::InvalidSpec—specis not one ofcpu,cuda,cuda:N(0..=15), orauto.DeviceError::CudaNotAvailable—specexplicitly asked for CUDA (orautochose CUDA) butcuda_training_available()returnedfalse.