cubecl_environment/stream/mod.rs
1//! Stream identity, policies and manual stream management.
2//!
3//! A stream is a logical submission queue: work on one stream executes in
4//! order, work on different streams may overlap. This module owns how the
5//! *current* stream is derived:
6//!
7//! - By default, every OS thread gets its own stream ([`StreamPolicy::PerThread`]).
8//! - Under tokio, [`StreamPolicy::PerTask`] keeps a task's stream stable across
9//! `.await` points even when the executor moves it between worker threads.
10//! - [`Stream`] gives manual control: `Stream::spawn`, `Stream::enter` and
11//! `Stream::attach` pin work to an explicit stream in any environment.
12
13mod handle;
14mod id;
15mod policy;
16
17pub use handle::*;
18pub use id::StreamId;
19pub use policy::*;