NVIDIAPiotr CiolkoszAnnouncement
CCCL Runtime: A Modern C++ Runtime for CUDA
Summary
NVIDIA CCCL runtime introduces modern C++ abstractions for fundamental CUDA programming concepts starting in CUDA Toolkit 13.2 and CCCL 3.2. Designed as an alternative to the traditional CUDA runtime API, the library eliminates implicit global state by requiring explicit dependencies, such as binding streams directly to specific device references. The API enforces strong typing through owning types and non-owning reference types, omits default stream usage to ensure all streams remain non-blocking, and handles errors via standard C++ exceptions. In addition, CCCL runtime simplifies kernel launches through kernel functors that enable automatic template argument deduction and automatically transforms owning buffer arguments into device spans.
Context
As CUDA programs grow more complex with multiple libraries sharing devices, streams, and memory, the traditional CUDA runtime API relies on implicit global state, such as associating new streams with whichever device happens to be active and depending on manual error-checking macros or status return codes.
Approach / What changed
CCCL runtime provides a collection of modern C++ headers including cuda/stream, cuda/buffer, and cuda/launch with strong typing and explicit dependencies. It distinguishes owning types from non-owning ref types for interoperability, excludes the implicit default stream, uses C++ exceptions for error handling, supports kernel functors with automatic template deduction, and automatically converts buffers to spans during kernel launch.
Takeaways
CCCL runtime replaces implicit global state with explicit dependencies, requiring streams to be constructed with a specific device reference and making all created streams non-blocking.
The runtime uses paired owning types and non-owning ref types, allowing seamless conversions and lifetime management alongside legacy raw handles like cudaStream_t.
Kernel functors with device call operators enable automatic template argument deduction during launch, while buffers passed to cuda::launch automatically transform into cuda::std::span.
Source and freshness
- Source
- developer.nvidia.com
- Published
- Added to Yomu
- Last updated
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.