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/// Various identifier types used in `CubeCL`.
31pub mod id;
32
33/// Kernel related traits.
34pub mod kernel;
35
36/// Throughput related utilities.
37pub mod throughput;
38
39/// Compute client module.
40pub mod client;
41
42/// The device type of each runtime.
43pub mod device;
44
45/// Autotune module
46pub mod tune;
47
48/// Memory management value types: reports, configuration and the managed
49/// handle. The pools behind them are `cubecl-server`'s.
50pub mod memory_management;
51/// Compute server module.
52pub mod server;
53/// Compute Storage contract.
54pub mod storage;
55
56/// `CubeCL` config module.
57pub mod config;
58
59pub use cubecl_common::benchmark;
60
61/// Logging utilities to be used by a compute server.
62pub mod logging;
63
64/// TMA-related runtime types
65pub mod tma;
66
67/// Compiler trait and related types
68pub mod compiler;
69/// Running a workload for the compilation and tuning it provokes, without
70/// running the workload itself.
71pub mod dry_run;
72pub mod launched;
73/// Runtime trait and related types
74pub mod runtime;