Skip to main content

baracuda_types/
lib.rs

1//! Shared type vocabulary for the baracuda CUDA stack.
2//!
3//! This crate contains only pure-data types — no I/O, no `libloading`, no
4//! runtime machinery. It's intended to be a cheap dependency for any crate
5//! (including user-authored CUDA wrappers) that wants to speak baracuda's
6//! type vocabulary without pulling in the loader infrastructure.
7//!
8//! # Modules
9//!
10//! - [`numeric`] — [`Half`], [`BFloat16`], [`Complex32`], [`Complex64`].
11//! - [`device_repr`] — the [`DeviceRepr`] trait marking ABI-stable types.
12//! - [`kernel_arg`] — the [`KernelArg`] trait for marshalling kernel arguments.
13//! - [`version`] — [`CudaVersion`] and the [`Feature`] enum with [`supports`].
14//! - [`status`] — the [`CudaStatus`] trait every library's status enum implements.
15//! - [`stream_mode`] — the [`StreamMode`] enum (Legacy vs PerThread default streams).
16
17#![no_std]
18#![warn(missing_debug_implementations)]
19
20pub mod device_repr;
21pub mod external_impls;
22pub mod host_slice;
23pub mod kernel_arg;
24pub mod numeric;
25pub mod status;
26pub mod stream_mode;
27pub mod version;
28pub mod zero_bits;
29
30pub use device_repr::DeviceRepr;
31pub use host_slice::HostSlice;
32pub use kernel_arg::KernelArg;
33pub use numeric::{BFloat16, Complex32, Complex64, Half};
34pub use status::CudaStatus;
35pub use stream_mode::StreamMode;
36pub use version::{supports, CudaVersion, Feature};
37pub use zero_bits::ValidAsZeroBits;
38
39/// `#[derive(DeviceRepr)]` — attribute macro re-exported from
40/// `baracuda-types-derive` when the `derive` feature is enabled.
41#[cfg(feature = "derive")]
42pub use baracuda_types_derive::DeviceRepr;