diff options
Diffstat (limited to 'candle-core')
-rw-r--r-- | candle-core/src/device.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/candle-core/src/device.rs b/candle-core/src/device.rs index 846c62ce..d0bec4f7 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(), + } + } } |