diff --git a/candle-core/src/device.rs b/candle-core/src/device.rs index 846c62ce2..d0bec4f77 100644 --- a/candle-core/src/device.rs +++ b/candle-core/src/device.rs @@ -337,4 +337,12 @@ impl Device { } } } + + pub fn synchronize(&self) -> Result<()> { + match self { + Self::Cpu => Ok(()), + Self::Cuda(d) => d.synchronize(), + Self::Metal(d) => d.synchronize(), + } + } }