cubecl_common/lib.rs
1#![no_std]
2#![warn(missing_docs)]
3
4//! # `CubeCL` Common Library
5//!
6//! This library contains common types used by other crates that must be shared.
7//!
8//! Environment shims (sync primitives, futures, streams, config, persistence)
9//! live in the `cubecl-environment` crate.
10
11#[cfg(feature = "std")]
12extern crate std;
13
14#[macro_use]
15extern crate derive_new;
16
17mod obfuscation;
18
19/// A circular, allocation-free arena for reusable memory blocks.
20#[cfg(feature = "std")]
21pub mod arena;
22
23/// Device module.
24pub mod device;
25
26/// Device handle module.
27pub mod device_handle {
28 pub use super::device::handle::{CallError, CallResultExt, DeviceHandle};
29}
30
31/// Utilities module to manipulate bytes.
32///
33/// Re-exported from `cubecl-environment`, which owns the type: this crate
34/// depends on it, so the lower layers could not otherwise use `Bytes`.
35pub use cubecl_environment::bytes;
36
37/// Module for benchmark timings
38pub mod benchmark;
39
40/// Module for profiling any executable part
41pub mod profile;
42
43/// A dynamically-growing pool that leases exclusive, reusable single-cell items.
44pub mod pool;
45
46/// Quantization primitives required outside of `cubecl-quant`
47pub mod quant;
48
49/// Format utilities.
50pub mod format;
51
52/// Various utilities to create ID's.
53extern crate alloc;
54
55/// Hashing helper for stable, collision resistant hashes
56#[cfg(feature = "hash")]
57pub mod hash;
58
59/// Custom float implementations
60mod float;
61
62pub use float::*;
63
64/// An exact ratio of two integers.
65mod ratio;
66
67pub use ratio::*;