1use thiserror::Error;
4
5#[derive(Debug, Error)]
7pub enum GpuError {
8 #[error("No GPU adapter available")]
10 NoAdapter,
11
12 #[error("GPU device request failed: {0}")]
14 DeviceRequest(String),
15
16 #[error("Buffer size mismatch: expected {expected}, got {got}")]
18 BufferSize { expected: usize, got: usize },
19
20 #[error("Unsupported quant type for GPU: {name}")]
22 UnsupportedType { name: String },
23
24 #[error("Shader compilation failed: {detail}")]
26 ShaderCompilation { detail: String },
27
28 #[error("GPU buffer mapping failed: {detail}")]
30 BufferMap { detail: String },
31}
32
33pub type GpuResult<T> = Result<T, GpuError>;