Skip to main content

Crate cubecl_environment

Crate cubecl_environment 

Source
Expand description

§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.
  • records: what an environment remembers of how it was built.

Modules§

backtrace
Backtrace module to build error reports.
bundle
Named environment bundles: ship pre-warmed autotune and compilation caches. Named environment bundles.
bytes
Byte buffers with allocation properties, zero-copy views and optional memory-mapped backing. The type to use for byte payloads, never Vec<u8>.
collections
Hash map and set types with the environment’s default hasher.
config
Runtime configuration trait shared across crates.
environment
Named environments: the local store everything is warmed into, one active at a time. Named environments.
future
Future utils with a compatible API for native, non-std and wasm environments.
persistence
Key-value persistence: in-memory stores synced to the file system, browser storage or kept memory-only depending on the environment. Key-value persistence.
rand
Rand module contains types for random number generation for non-std environments and for std environments.
records
What an environment remembers of how it was built.
stream
Stream identity, policies and manual stream management. Stream identity, policies and manual stream management.
sync
Synchronization primitives working across std, no-std and wasm environments.
thread
Thread spawning, on the targets that have threads. Empty elsewhere: use future::spawn_detached, which is portable.
time
Time types working across std, wasm and embedded environments.