baracuda_cuda_sys/lib.rs
1//! Raw FFI + dynamic loader for the CUDA Driver API (and, in later sprint
2//! days, the Runtime API). Consumed by the safe wrappers in
3//! `baracuda-driver` / `baracuda-runtime`.
4//!
5//! # Layout
6//!
7//! - [`types`] — opaque handle types (`CUcontext`, `CUstream`, ...),
8//! integer handle newtypes (`CUdevice`, `CUdeviceptr`), and flag modules.
9//! - [`status`] — [`CUresult`] with its [`baracuda_types::CudaStatus`] impl.
10//! - [`functions`] — `PFN_*` function-pointer type aliases.
11//! - [`mod@driver`] — the [`Driver`] struct and the process-wide [`driver()`]
12//! accessor that loads `libcuda` once via `libloading` and resolves every
13//! other symbol through `cuGetProcAddress`.
14//!
15//! # Dynamic loading
16//!
17//! Nothing in this crate is linked against `libcuda` at build time. On
18//! machines without CUDA, calling [`driver()`] returns
19//! [`baracuda_core::LoaderError::LibraryNotFound`] — callers never crash
20//! merely by linking this crate.
21
22#![warn(missing_debug_implementations)]
23
24pub mod driver;
25pub mod functions;
26pub mod runtime;
27pub mod status;
28pub mod types;
29
30pub use driver::{driver, Driver};
31pub use runtime::{runtime, Runtime};
32pub use status::CUresult;
33pub use types::*;