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
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/// Map utilities and implementations.
34pub mod map;
35
36/// Utilities module to manipulate bytes.
37#[cfg(feature = "serde")]
38pub mod bytes;
39
40/// Stub module contains types for stubs for non-std environments and for std environments.
41pub mod stub;
42
43/// Stream id related utilities.
44pub mod stream_id;
45
46/// Cache module for an efficient in-memory and persistent database.
47#[cfg(feature = "cache")]
48pub mod cache;
49
50#[cfg(feature = "cache")]
51pub(crate) mod cache_file;
52
53/// Chunked cache optimized for compilation artifacts
54#[cfg(feature = "compilation-cache")]
55pub mod compilation_cache;
56
57/// Module for benchmark timings
58pub mod benchmark;
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::*;