1use std::io;
2
3#[cfg(any(feature = "cuda", feature = "opencl"))]
4use rust_gpu_tools::GPUError;
5
6#[derive(thiserror::Error, Debug)]
8pub enum EcError {
9 #[error("EcError: {0}")]
11 Simple(&'static str),
12
13 #[cfg(any(feature = "cuda", feature = "opencl"))]
15 #[error("GPU call was aborted!")]
16 Aborted,
17
18 #[cfg(any(feature = "cuda", feature = "opencl"))]
20 #[error("GPU tools error: {0}")]
21 GpuTools(#[from] GPUError),
22
23 #[error("Encountered an I/O error: {0}")]
25 Io(#[from] io::Error),
26}
27
28pub type EcResult<T> = std::result::Result<T, EcError>;