use std::io;
#[cfg(any(feature = "cuda", feature = "opencl"))]
use rust_gpu_tools::GPUError;
#[derive(thiserror::Error, Debug)]
pub enum EcError {
#[error("EcError: {0}")]
Simple(&'static str),
#[cfg(any(feature = "cuda", feature = "opencl"))]
#[error("GPU call was aborted!")]
Aborted,
#[cfg(any(feature = "cuda", feature = "opencl"))]
#[error("GPU tools error: {0}")]
GpuTools(#[from] GPUError),
#[error("Encountered an I/O error: {0}")]
Io(#[from] io::Error),
}
pub type EcResult<T> = std::result::Result<T, EcError>;