Skip to content

Commit

Permalink
Expose the synchronize function on the generic device.
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentMazare committed Apr 14, 2024
1 parent 4ecedb1 commit 227a2b0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions candle-core/src/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
}
}
}

0 comments on commit 227a2b0

Please sign in to comment.