Skip to main content

ferrox_cuda/
lib.rs

1//! ferrox-cuda: hardware capability detection (always compiled, always
2//! tested) plus an optional, feature-gated CUDA execution path.
3//!
4//! Build without any GPU support (the default): `cargo build -p ferrox-cuda`.
5//! Build with the CUDA scaffolding included: `cargo build -p ferrox-cuda --features cuda`.
6//!
7//! The `cuda` feature compiles cleanly in this development sandbox
8//! (which has neither a CUDA toolkit nor a GPU) because `cudarc` is
9//! configured for dynamic loading -- the driver and NVRTC libraries
10//! are `dlopen`'d at runtime, not linked at build time. That means
11//! "this crate compiles with `--features cuda`" is a true, checked
12//! fact. It does **not** mean the CUDA kernels in `gpu.rs` have ever
13//! executed successfully; see that module's docs for exactly what has
14//! and has not been verified.
15
16pub mod capability;
17
18/// The `mul_mm` kernel source and its per-quant-kind dispatch table.
19/// Always compiled: it is CUDA C *text* plus a scalar twin, neither of
20/// which needs `cudarc`, so the default `cargo test -p ferrox-cuda` run
21/// on a GPU-less host still exercises the arithmetic the kernel encodes.
22/// Only the launch path ([`mul_mm_launch`]) is feature-gated.
23pub mod mul_mm;
24pub mod mul_mm_ref;
25
26#[cfg(feature = "cuda")]
27pub mod attn;
28#[cfg(feature = "cuda")]
29pub mod gpu;
30#[cfg(feature = "cuda")]
31pub mod graph;
32#[cfg(feature = "cuda")]
33pub mod mul_mm_launch;
34
35pub use capability::{HardwareProfile, SimdCaps};