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