Skip to main content

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/// The work a benchmark or a kernel performs, for scoring against measured peaks.
41pub mod work;
42
43/// Module for profiling any executable part
44pub mod profile;
45
46/// A dynamically-growing pool that leases exclusive, reusable single-cell items.
47pub mod pool;
48
49/// Quantization primitives required outside of `cubecl-quant`
50pub mod quant;
51
52/// Format utilities.
53pub mod format;
54
55/// Various utilities to create ID's.
56extern crate alloc;
57
58/// Hashing helper for stable, collision resistant hashes
59#[cfg(feature = "hash")]
60pub mod hash;
61
62/// Custom float implementations
63mod float;
64
65pub use float::*;
66
67/// An exact ratio of two integers.
68mod ratio;
69
70pub use ratio::*;