Skip to content

Commit

Permalink
clarified error
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisChourakiSonos committed Dec 6, 2024
1 parent 92f0b0c commit bffae70
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion metal/src/command_buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use std::cell::RefCell;
use std::collections::HashMap;
use std::ops::{Deref, DerefMut};
use std::rc::Rc;
use tract_core::internal::anyhow;

const NUM_SAMPLES: u64 = 2;

Expand Down Expand Up @@ -57,7 +58,11 @@ impl MetalProfiler {
}

pub fn add_buffer(&mut self, buffer: Buffer) {
let current_node_id = &self.current_node_id.unwrap();
let current_node_id = &self.current_node_id.ok_or_else(|| {
anyhow!(
"Metal profile doesn't have any current node id to attach a sampling buffer for"
)
})?;
let node_values = self
.profile_buffers
.get_mut(current_node_id)
Expand Down

0 comments on commit bffae70

Please sign in to comment.