cubecl_runtime/lib.rs
1#![no_std]
2#![warn(missing_docs)]
3
4//! The runtime API of `CubeCL`: what a kernel author compiles against.
5//!
6//! A [`Client`](client::Client) reaches a device, a [`Handle`](server::Handle)
7//! names memory on it, and a [`CubeKernel`](kernel::CubeKernel) is what a
8//! launch hands over. The [`Server`](server::Server) trait is the contract a
9//! runtime implements, and everything an implementation needs beyond the
10//! contract — memory pools, streams, drivers, the compilation pipeline — lives
11//! in `cubecl-server`, so that user code never depends on it.
12//!
13//! # Error handling
14//!
15//! A failure belongs to the memory that work left unwritten and travels the
16//! dataflow from there: nothing here holds error state beside the buffers.
17//! `Taint`, `ErrorGraph`, `Failures` and `ExecuteScope` in `cubecl-server` are
18//! the four pieces, and `ERROR_HANDLING.md` at the repository root is the
19//! argument for why they are shaped that way — read it before changing any of
20//! them.
21
22#[cfg(feature = "std")]
23extern crate std;
24
25extern crate alloc;
26
27#[macro_use]
28extern crate derive_new;
29
30/// The source directory of the kernel debug data.
31#[cfg(feature = "std")]
32pub mod debug_source;
33
34/// Various identifier types used in `CubeCL`.
35pub mod id;
36
37/// Kernel related traits.
38pub mod kernel;
39
40/// Throughput related utilities.
41pub mod throughput;
42
43/// Compute client module.
44pub mod client;
45
46/// The device type of each runtime, and which hardware a device is.
47pub mod device;
48
49#[cfg(persistence)]
50mod namespace_version;
51
52/// Autotune module
53pub mod tune;
54
55/// Memory management value types: reports, configuration and the managed
56/// handle. The pools behind them are `cubecl-server`'s.
57pub mod memory_management;
58/// Compute server module.
59pub mod server;
60/// Compute Storage contract.
61pub mod storage;
62
63/// `CubeCL` config module.
64pub mod config;
65
66pub use cubecl_common::benchmark;
67
68/// Logging utilities to be used by a compute server.
69pub mod logging;
70
71/// TMA-related runtime types
72pub mod tma;
73
74/// Compiler trait and related types
75pub mod compiler;
76/// Device identity and properties.
77pub mod description;
78pub mod execution;
79pub mod launched;
80/// The payload every error type carries when the device is poisoned.
81pub mod poison;
82/// Runtime trait and related types
83pub mod runtime;