Skip to main content

kaio_runtime/
lib.rs

1//! # kaio-runtime
2//!
3//! CUDA runtime layer for the KAIO GPU kernel authoring framework. This
4//! crate wraps [`cudarc`] to provide device management, typed device
5//! buffers, PTX module loading, and a builder-style kernel launch API. It
6//! is Layer 2 of KAIO, sitting on top of [`kaio-core`] (PTX emission).
7//!
8//! ## Quick start
9//!
10//! ```ignore
11//! use kaio_runtime::{KaioDevice, GpuBuffer};
12//!
13//! let device = KaioDevice::new(0)?;
14//! let buf = device.alloc_from(&[1.0f32, 2.0, 3.0])?;
15//! let host = buf.to_host(&device)?;
16//! assert_eq!(host, vec![1.0, 2.0, 3.0]);
17//! ```
18//!
19//! ## GPU-gated tests
20//!
21//! Tests that require an NVIDIA GPU are `#[ignore]`-gated. Run them with:
22//!
23//! ```sh
24//! cargo test -p kaio-runtime -- --ignored
25//! ```
26//!
27//! Standard `cargo test --workspace` runs only host-side tests.
28//!
29//! [`cudarc`]: https://crates.io/crates/cudarc
30//! [`kaio-core`]: https://crates.io/crates/kaio-core
31
32#![warn(missing_docs)]
33
34pub mod buffer;
35pub mod device;
36pub mod error;
37pub mod module;
38
39pub use buffer::GpuBuffer;
40pub use cudarc::driver::LaunchConfig;
41pub use cudarc::driver::PushKernelArg;
42pub use device::{DeviceInfo, KaioDevice};
43pub use error::{KaioError, Result};
44pub use module::{KaioFunction, KaioModule};