Files
pytorch/docs/cpp/source/api/c10/streams.md
T
Svetlana Karslioglu 19da3da3d3 Restructure C++ docs (#174096)
The fix-cpp-build branch is a major restructuring that:

- Drops Exhale (which auto-generated API docs but caused OOM in CI) in favor of hand-written RST pages using Breathe directives
- Reorganizes notes into a hierarchical API reference with proper categories
- Adds new content: XPU docs, stable ABI docs, DeviceGuard/Stream docs
- Always runs Doxygen instead of gating on an env var

Pull Request resolved: https://github.com/pytorch/pytorch/pull/174096
Approved by: https://github.com/janeyx99, https://github.com/seemethere, https://github.com/albanD
2026-04-07 17:24:38 +00:00

833 B

myst
myst
html_meta
description keywords
Stream API in PyTorch C++ — c10::Stream for asynchronous execution on devices. PyTorch, C++, Stream, c10::Stream, asynchronous, device

Streams

c10::Stream is the device-agnostic base stream class. It provides a common interface for working with streams across different backends (CUDA, XPU, etc.).

For backend-specific stream APIs, see {doc}../cuda/streams and {doc}../xpu/index.

Stream

:members:
:undoc-members:

Example:

#include <c10/core/Stream.h>

// Streams are typically obtained from backend-specific APIs
auto cuda_stream = c10::cuda::getCurrentCUDAStream();

// c10::Stream provides the common interface
c10::Device device = cuda_stream.device();
c10::DeviceType type = cuda_stream.device_type();