Skip to main content

axonml_fusion/
error.rs

1//! Fusion Error Types
2//!
3//! Error types for kernel fusion operations.
4//!
5//! @version 0.1.0
6//! @author AutomataNexus Development Team
7
8use thiserror::Error;
9
10/// Result type for fusion operations.
11pub type FusionResult<T> = Result<T, FusionError>;
12
13/// Errors that can occur during kernel fusion.
14#[derive(Error, Debug)]
15pub enum FusionError {
16    /// Invalid input shape.
17    #[error("Invalid input shape: expected {expected:?}, got {actual:?}")]
18    ShapeMismatch {
19        /// Expected shape.
20        expected: Vec<usize>,
21        /// Actual shape.
22        actual: Vec<usize>,
23    },
24
25    /// Pattern not fusable.
26    #[error("Pattern not fusable: {0}")]
27    NotFusable(String),
28
29    /// Invalid fusion configuration.
30    #[error("Invalid fusion configuration: {0}")]
31    InvalidConfig(String),
32
33    /// Execution error.
34    #[error("Execution error: {0}")]
35    Execution(String),
36
37    /// Tensor conversion error.
38    #[error("Tensor conversion error: {0}")]
39    TensorError(String),
40}