1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//! # `CubeCL` Environment Library
//!
//! A cohesive API over the environment the code runs on: sync/std/thread,
//! async/tokio, async/wasm and no-std.
//!
//! The crate is organized in pillars:
//! - Compatibility shims mirroring `std` module names: [`sync`], [`collections`],
//! [`time`], [`thread`], [`future`], plus [`rand`] and [`backtrace`].
//! - [`stream`]: stream identity and policies, including tokio task-stable streams.
//! - [`config`]: global configuration loading (`cubecl.toml` and friends).
//! - [`persistence`]: key-value caches kept up to date in memory and synced to the
//! file system (std), browser storage (wasm) or nothing (no-std).
//! - [`bundle`]: named environment bundles that ship pre-warmed caches.
extern crate std;
extern crate alloc;
/// Synchronization primitives working across std, no-std and wasm environments.
/// Byte buffers with allocation properties, zero-copy views and optional
/// memory-mapped backing. The type to use for byte payloads, never `Vec<u8>`.
/// Hash map and set types with the environment's default hasher.
/// Time types working across std, wasm and embedded environments.
/// Thread spawning, on the targets that have threads. Empty elsewhere: use
/// [`future::spawn_detached`], which is portable.
/// Future utils with a compatible API for native, non-std and wasm environments.
/// Rand module contains types for random number generation for non-std environments and for
/// std environments.
/// Backtrace module to build error reports.
/// Stream identity, policies and manual stream management.
/// Named environments: the local store everything is warmed into, one active
/// at a time.
/// Runtime configuration trait shared across crates.
/// Key-value persistence: in-memory stores synced to the file system, browser
/// storage or kept memory-only depending on the environment.
/// Named environment bundles: ship pre-warmed autotune and compilation caches.