Skip to main content

singe_cuda/stream/
cleanup.rs

1use singe_core::abort_after_cleanup_failure;
2
3use crate::context::Context;
4
5impl Context {
6    /// Waits for all queued work in this context, or prints the error and aborts the process if the wait fails.
7    ///
8    /// Cleanup code calls this before releasing borrowed storage that queued work may still access.
9    pub fn synchronize_or_abort(&self) {
10        if let Err(error) = self.synchronize() {
11            abort_after_cleanup_failure("synchronize", "cuda context", &error);
12        }
13    }
14}