singe-cuda 0.1.0

Safe Rust wrappers for the CUDA driver and runtime APIs, including runtime compilation of CUDA C++ and NVTX annotations.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use singe_core::abort_after_cleanup_failure;

use crate::context::Context;

impl Context {
    /// Waits for all queued work in this context, or prints the error and aborts the process if the wait fails.
    ///
    /// Cleanup code calls this before releasing borrowed storage that queued work may still access.
    pub fn synchronize_or_abort(&self) {
        if let Err(error) = self.synchronize() {
            abort_after_cleanup_failure("synchronize", "cuda context", &error);
        }
    }
}