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
28pub use serde;
29
30// The runtime API, re-exported so `crate::server::Handle` and
31// `cubecl_server::server::Handle` both name the one type.
32pub use cubecl_runtime::benchmark;
33pub use cubecl_runtime::{
34 client, config, device, execution, id, launched, logging, runtime, throughput, tma, tune,
35};
36pub use cubecl_runtime::{local_tuner, storage_id_type};
37
38/// Kernel related traits, and the compiled kernel a launch produces.
39pub mod kernel;
40
41/// Stream related utilities.
42pub mod stream;
43
44/// Memory management module.
45pub mod memory_management;
46/// Cache of per-launch kernel metadata info buffers.
47pub mod metadata_cache;
48/// Compute server module.
49pub mod server;
50/// Compute Storage module.
51pub mod storage;
52
53#[cfg(multi_threading)]
54pub mod command;
55
56pub mod driver;
57
58pub mod device_events;
59
60/// Compiler trait, and the compilation caches in front of one.
61pub mod compiler;
62/// Simple system profiling using timestamps.
63pub mod timestamp_profiler;
64
65/// Validation utils for shared properties
66pub mod validation;
67
68/// Allocators moddule.
69pub mod allocator;