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