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#[cfg(feature = "std")]
9extern crate std;
10
11#[macro_use]
12extern crate derive_new;
13
14/// Rand module contains types for random number generation for non-std environments and for
15/// std environments.
16pub mod rand;
17
18mod obfuscation;
19
20/// A circular, allocation-free arena for reusable memory blocks.
21#[cfg(feature = "std")]
22pub mod arena;
23
24/// Backtrace module to build error reports.
25pub mod backtrace;
26
27/// Device module.
28pub mod device;
29
30/// Device handle module.
31pub mod device_handle {
32    pub use super::device::handle::{CallError, CallResultExt, DeviceHandle};
33}
34
35/// Utilities module to manipulate bytes.
36#[cfg(feature = "serde")]
37pub mod bytes;
38
39/// Stub module contains types for stubs for non-std environments and for std environments.
40pub mod stub;
41
42/// Stream id related utilities.
43pub mod stream_id;
44
45/// Cache module for an efficient in-memory and persistent database.
46#[cfg(feature = "cache")]
47pub mod cache;
48
49#[cfg(feature = "cache")]
50pub(crate) mod cache_file;
51
52/// Chunked cache optimized for compilation artifacts
53#[cfg(feature = "compilation-cache")]
54pub mod compilation_cache;
55
56/// Module for benchmark timings
57pub mod benchmark;
58
59/// Runtime configuration trait shared across crates.
60pub mod config;
61
62/// Module for profiling any executable part
63pub mod profile;
64
65/// A dynamically-growing pool that leases exclusive, reusable single-cell items.
66pub mod pool;
67
68/// Useful when you need to read async data without having to decorate each function with async
69/// notation.
70pub mod reader;
71
72/// Future utils with a compatible API for native, non-std and wasm environments.
73pub mod future;
74
75/// Quantization primitives required outside of `cubecl-quant`
76pub mod quant;
77
78/// Format utilities.
79pub mod format;
80
81/// Various utilities to create ID's.
82extern crate alloc;
83
84/// Hashing helper for stable, collision resistant hashes
85#[cfg(feature = "hash")]
86pub mod hash;
87
88/// Custom float implementations
89mod float;
90
91pub use float::*;