singe_cuda/lib.rs
1//! Safe CUDA wrappers.
2//!
3//! This crate wraps CUDA Driver, CUDA Runtime, NVRTC, NVVM, NVTX, contexts, streams,
4//! events, device memory, modules, kernels, graphs, IPC, and JIT helpers. It
5//! keeps unsafe FFI calls at the boundary while still exposing enough low-level
6//! control for inference runtimes and NVIDIA library wrappers.
7//!
8//! # Examples
9//!
10//! ```no_run
11//! use singe_cuda::{
12//! context::Context,
13//! memory::DeviceMemory,
14//! };
15//!
16//! let ctx = Context::create()?;
17//! let stream = ctx.create_stream()?;
18//!
19//! let mut memory = DeviceMemory::<f32>::create(1024)?;
20//! memory.copy_from_host(&vec![1.0_f32; 1024])?;
21//! stream.synchronize()?;
22//!
23//! println!("CUDA driver v{}", singe_cuda::driver::version()?);
24//! # Ok::<(), singe_cuda::error::Error>(())
25//! ```
26
27pub mod driver;
28pub mod runtime;
29
30pub mod architecture;
31pub mod checkpoint;
32pub mod context;
33pub mod data_type;
34pub mod device;
35pub mod dim;
36pub mod error;
37pub mod event;
38pub mod external_memory;
39pub mod future;
40pub mod graph;
41pub mod ipc;
42pub mod jit;
43pub mod kernel;
44pub mod library;
45pub mod memory;
46pub mod module;
47pub mod nvrtc;
48pub mod nvtx;
49pub mod nvvm;
50pub mod profile;
51pub mod stream;
52pub mod types;
53pub mod view;
54
55pub(crate) mod utility;
56
57#[cfg(feature = "macros")]
58pub use singe_cuda_macros::cuda_module;
59
60#[cfg(feature = "testing")]
61pub mod testing;