atlas_core/
error.rs

1// SPDX-License-Identifier: AGPL-3.0-only
2
3use thiserror::Error;
4
5#[derive(Error, Debug)]
6pub enum AtlasError {
7    #[cfg(feature = "cuda")]
8    #[error("CUDA driver error: {0}")]
9    CudaDriver(#[from] cudarc::driver::DriverError),
10
11    #[error("CUDA kernel launch failed: {0}")]
12    KernelLaunch(String),
13
14    #[error("Shape mismatch: expected {expected}, got {actual}")]
15    ShapeMismatch { expected: String, actual: String },
16
17    #[error("Unsupported dtype: {0:?}")]
18    UnsupportedDType(crate::dtype::DType),
19
20    #[error("Unsupported configuration: {0}")]
21    UnsupportedConfig(String),
22
23    #[error("Device not found: {0}")]
24    DeviceNotFound(String),
25
26    #[error("Module load failed: {0}")]
27    ModuleLoad(String),
28}
29
30pub type Result<T> = std::result::Result<T, AtlasError>;