Skip to main content

Crate singe_cuda

Crate singe_cuda 

Source
Expand description

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

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()?);

Modules§

architecture
checkpoint
context
data_type
device
dim
driver
error
event
external_memory
Safe ownership wrappers for CUDA external memory imports.
future
graph
ipc
jit
kernel
library
memory
module
nvrtc
nvtx
nvvm
profile
CUDA profiler control helpers.
runtime
stream
types
view
Borrowed typed views over CUDA-accessible memory.

Macros§

cuda_module
Compiles CUDA source with nvcc and generates a typed kernel-launch module.
try_ffi
try_nvrtc
try_nvvm