Skip to main content

morok_schedule/optimizer/
error.rs

1use snafu::Snafu;
2
3#[derive(Debug, Clone, PartialEq, Eq, Snafu)]
4#[snafu(visibility(pub))]
5pub enum OptError {
6    #[snafu(display("invalid argument type for operation; expected {expected}, found {found}"))]
7    InvalidArgType { expected: &'static str, found: &'static str },
8    #[snafu(display("operation validation failed for {op}: {reason}"))]
9    ValidationFailed { op: &'static str, reason: &'static str },
10    #[snafu(display("axis out of bounds: axis {axis} > max {max}"))]
11    AxisOutOfBounds { axis: usize, max: usize },
12    #[snafu(display("division constraint violated: {size} is not divisible by {amount}"))]
13    DivisionError { size: usize, amount: usize },
14    #[snafu(display("symbolic size cannot be verified for divisibility by {amount}"))]
15    SymbolicDivisionError { amount: usize },
16    #[snafu(display("expected Range operation, found other operation type"))]
17    ExpectedRangeOperation,
18    #[snafu(display("missing axis parameter for operation"))]
19    MissingAxisParameter,
20    #[snafu(display("backend doesn't support required feature: {feature}"))]
21    UnsupportedFeature { feature: &'static str },
22    #[snafu(display("optimization would exceed device limit: {limit_type} {value} > max {max}"))]
23    DeviceLimitExceeded { limit_type: &'static str, value: usize, max: usize },
24    // /// Tensor core pattern not matched.
25    // TensorCoreNotMatched { reason: String },
26}