#[derive(Debug, thiserror::Error)]
pub enum KaioError {
#[error("CUDA driver error: {0}")]
Cuda(#[from] cudarc::driver::DriverError),
#[error("out of device memory: requested {requested} bytes")]
OutOfMemory {
requested: usize,
},
#[error("invalid kernel configuration: {0}")]
InvalidConfig(String),
#[error("device not found: ordinal {0}")]
DeviceNotFound(usize),
#[error("PTX module load failed: {0}")]
PtxLoad(String),
#[error("PTX module validation failed: {0}")]
Validation(#[from] kaio_core::ir::ValidationError),
}
pub type Result<T> = std::result::Result<T, KaioError>;