oxiphysics_gpu/compute/
gpuerror_traits.rs1#[allow(unused_imports)]
12use super::functions::*;
13use super::types::GpuError;
14
15impl std::fmt::Display for GpuError {
16 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17 match self {
18 GpuError::InvalidBuffer(id) => write!(f, "invalid buffer id: {}", id.0),
19 GpuError::SizeMismatch { expected, got } => {
20 write!(f, "size mismatch: expected {expected}, got {got}")
21 }
22 GpuError::EmptyBuffer => write!(f, "reduction on empty buffer"),
23 GpuError::NotFound(name) => write!(f, "not found: {name}"),
24 }
25 }
26}