Skip to main content

cubecl_server/
lib.rs

1#![no_std]
2#![warn(missing_docs)]
3
4//! The toolkit for implementing a `CubeCL` runtime.
5//!
6//! A runtime depends on this crate, not on `cubecl-runtime` directly: every
7//! module of the runtime API is re-exported here under the same name, so an
8//! implementation sees one tree — the contract it implements and the pieces
9//! it implements it with.
10//!
11//! # Error handling
12//!
13//! A failure belongs to the memory that work left unwritten and travels the
14//! dataflow from there: nothing here holds error state beside the buffers.
15//! [`memory_management::Taint`], [`memory_management::ErrorGraph`],
16//! [`stream::Failures`] and [`stream::ExecuteScope`] are the four pieces, and
17//! `ERROR_HANDLING.md` at the repository root is the argument for why they are
18//! shaped that way — read it before changing any of them.
19
20#[cfg(feature = "std")]
21extern crate std;
22
23extern crate alloc;
24
25#[macro_use]
26extern crate derive_new;
27
28// The runtime API, re-exported so `crate::server::Handle` and
29// `cubecl_server::server::Handle` both name the one type.
30pub use cubecl_runtime::benchmark;
31pub use cubecl_runtime::{
32    client, config, device, dry_run, id, launched, logging, runtime, throughput, tma, tune,
33};
34pub use cubecl_runtime::{local_tuner, storage_id_type};
35
36/// Kernel related traits, and the compiled kernel a launch produces.
37pub mod kernel;
38
39/// Stream related utilities.
40pub mod stream;
41
42/// Memory management module.
43pub mod memory_management;
44/// Cache of per-launch kernel metadata info buffers.
45pub mod metadata_cache;
46/// Compute server module.
47pub mod server;
48/// Compute Storage module.
49pub mod storage;
50
51#[cfg(multi_threading)]
52pub mod command;
53
54pub mod driver;
55
56pub mod device_events;
57
58/// Compiler trait, and the compilation caches in front of one.
59pub mod compiler;
60/// Simple system profiling using timestamps.
61pub mod timestamp_profiler;
62
63/// Validation utils for shared properties
64pub mod validation;
65
66/// Allocators moddule.
67pub mod allocator;