onnx_runtime_memory/
error.rs1use onnx_runtime_ir::ValueId;
4
5use crate::plan::SlotId;
6
7#[derive(Clone, Copy, Debug, PartialEq, Eq, thiserror::Error)]
9pub enum PlanError {
10 #[error("graph is not schedulable (cycle detected); cannot compute liveness")]
13 Cycle,
14}
15
16#[derive(Clone, Copy, Debug, PartialEq, Eq, thiserror::Error)]
18pub enum ValidateError {
19 #[error("values {a:?} and {b:?} have overlapping live intervals but share slot {slot:?}")]
22 SlotConflict {
23 a: ValueId,
24 b: ValueId,
25 slot: SlotId,
26 },
27 #[error("value {value:?} needs {needed} bytes but slot {slot:?} has capacity {capacity}")]
29 UndersizedSlot {
30 value: ValueId,
31 slot: SlotId,
32 needed: usize,
33 capacity: usize,
34 },
35 #[error("buffer owner {value:?} has no slot assignment")]
37 MissingAssignment { value: ValueId },
38 #[error("value {value:?} references unknown slot {slot:?}")]
40 UnknownSlot { value: ValueId, slot: SlotId },
41 #[error("view {view:?} is used at node {view_use} but its source {source_owner:?} is retired at node {source_end}")]
44 ViewOutlivesSource {
45 view: ValueId,
46 source_owner: ValueId,
47 view_use: usize,
48 source_end: usize,
49 },
50 #[error("graph is not schedulable (cycle detected)")]
52 Cycle,
53}