1use std::path::PathBuf;
4use thiserror::Error;
5
6pub type Result<T> = std::result::Result<T, Error>;
8
9#[derive(Debug, Error)]
11pub enum Error {
12 #[error("nvcc not found: {0}. Set NVCC environment variable or ensure nvcc is in PATH")]
14 NvccNotFound(String),
15
16 #[error("CUDA toolkit not found at {0}")]
18 CudaToolkitNotFound(PathBuf),
19
20 #[error("Failed to detect compute capability: {0}")]
22 ComputeCapDetectionFailed(String),
23
24 #[error("Kernel compilation failed for {path}: {message}")]
26 CompilationFailed {
27 path: PathBuf,
29 message: String,
31 },
32
33 #[error("Linking failed: {0}")]
35 LinkingFailed(String),
36
37 #[error("Source path does not exist: {0}")]
39 SourcePathNotFound(PathBuf),
40
41 #[error("Git operation failed: {0}")]
43 GitOperationFailed(String),
44
45 #[error("IO error: {0}")]
47 Io(#[from] std::io::Error),
48
49 #[error("Cache error: {0}")]
51 CacheError(String),
52
53 #[error("Invalid configuration: {0}")]
55 InvalidConfig(String),
56}