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 #[cfg(feature = "std")]
29 pub use super::device::handle::ProcessCpus;
30 pub use super::device::handle::{
31 CallError, CallResultExt, DeviceHandle, ServiceCreationError, SpawnedCall,
32 };
33}
34
35/// Utilities module to manipulate bytes.
36///
37/// Re-exported from `cubecl-environment`, which owns the type: this crate
38/// depends on it, so the lower layers could not otherwise use `Bytes`.
39pub use cubecl_environment::bytes;
40
41/// Module for benchmark timings
42pub mod benchmark;
43
44/// The work a benchmark or a kernel performs, for scoring against measured peaks.
45pub mod work;
46
47/// Module for profiling any executable part
48pub mod profile;
49
50/// A dynamically-growing pool that leases exclusive, reusable single-cell items.
51pub mod pool;
52
53/// Quantization primitives required outside of `cubecl-quant`
54pub mod quant;
55
56/// Format utilities.
57pub mod format;
58
59/// Various utilities to create ID's.
60extern crate alloc;
61
62/// Hashing helper for stable, collision resistant hashes
63#[cfg(feature = "hash")]
64pub mod hash;
65
66/// Custom float implementations
67mod float;
68
69pub use float::*;
70
71/// An exact ratio of two integers.
72mod ratio;
73
74pub use ratio::*;
75
76/// Polyfills for things that aren't great in normal Rust (just powi right now)
77mod polyfill;
78
79pub use polyfill::*;