NVIDIA/cccl v3.2.0
NVIDIA/cccl
Captured source
source ↗v3.2.0
Repository: NVIDIA/cccl
Tag: v3.2.0
Published: 2026-02-05T21:55:24Z
Prerelease: no
Release notes:
The CCCL team is excited to announce the 3.2 release of the CUDA Core Compute Library (CCCL) whose highlights include new modern CUDA C++ runtime APIs and new speed-of-light algorithms including Top-K.
Modern CUDA C++ Runtime
CCCL 3.2 broadly introduces new, idiomatic C++ interfaces for core CUDA runtime and driver functionality.
If you’ve written CUDA C++ for a while, you’ve likely built (or adopted) some form of convenience wrappers around today’s C-like APIs like cudaMalloc or cudaStreamCreate.
The new APIs added in CCCL 3.2 are meant to provide the productivity and safety benefits of C++ for core CUDA constructs so you can spend less time reinventing wrappers and more time writing kernels and algorithms.
Highlights:
- New convenient vocabulary types for core CUDA concepts (
cuda::stream,cuda::event,cuda::arch_traits) - Easier memory management with Memory Resources and
cuda::buffer - More powerful and convenient kernel launch with
cuda::launch
Example (vector add, revisited):
cuda::device_ref device = cuda::devices[0];
cuda::stream stream{device};
auto pool = cuda::device_default_memory_pool(device);
int num_elements = 1000;
auto A = cuda::make_buffer(stream, pool, num_elements, 1.0);
auto B = cuda::make_buffer(stream, pool, num_elements, 2.0);
auto C = cuda::make_buffer(stream, pool, num_elements, cuda::no_init);
constexpr int threads_per_block = 256;
auto config = cuda::distribute(num_elements);
auto kernel = [] __device__ (auto config, cuda::std::span A,
cuda::std::span B,
cuda::std::span C){
auto tid = cuda::gpu_thread.rank(cuda::grid, config);
if (tid
### Fixed-size Segmented Reduction
CCCL 3.2 now provides a new [cub::DeviceSegmentedReduce](https://nvidia.github.io/cccl/cub/api/structcub_1_1DeviceSegmentedReduce.html#_CPPv4I0000EN3cub21DeviceSegmentedReduce6ReduceE11cudaError_tPvR6size_t14InputIteratorT15OutputIteratorTN4cudaSt7int64_tEi12ReductionOpT1T12cudaStream_t) variant that accepts a uniform segment_size, eliminating offset iterator overhead in the common case when segments are fixed-size. This enables optimizations for both small segment sizes (up to 66x) and large segment sizes (up to 14x).// New API accepts fixed segment_size instead of per-segment begin/end offsets cub::DeviceSegmentedReduce::Sum(d_temp, temp_bytes, input, output, num_segments, segment_size);
### Additional New Algorithms in CCCL 3.2 [Segmented Scan](https://nvidia.github.io/cccl/cub/api/structcub_1_1DeviceSegmentedScan.html) - cub::DeviceSegmentedScan provides a segmented version of a parallel scan that efficiently computes a scan operation over multiple independent segments. [Binary Search](https://nvidia.github.io/cccl/cub/api/structcub_1_1DeviceFind.html#cub-devicefind) - cub::DeviceFind::[Upper/LowerBound] performs a parallel search for multiple values in an ordered sequence. [Search](https://nvidia.github.io/cccl/cub/api/structcub_1_1DeviceFind.html#cub-devicefind) - cub::DeviceFind::FindIf searches the unordered input for the first element that satisfies a given condition. Thanks to its early-exit logic, it can be up to 7x faster than searching the entire sequence. **Full Changelog**: https://github.com/NVIDIA/cccl/compare/v3.1.4...v3.2.0 ## What's Changed ### 🚀 Thrust / CUB * Modified test [reduce][nondeterministic] per gh-5443 by @oleksandr-pavlyk in https://github.com/NVIDIA/cccl/pull/5451 * Remove unused include of grid/grid_queue from CUB agent/dispatch headers by @oleksandr-pavlyk in https://github.com/NVIDIA/cccl/pull/5887 * [CUB] Implement `BlockLoadToShared` by @pauleonix in https://github.com/NVIDIA/cccl/pull/5780 * Fix debug section around line 390 of dispatch_topk by @oleksandr-pavlyk in https://github.com/NVIDIA/cccl/pull/6152 * Fix typos in segmented reduce by @oleksandr-pavlyk in https://github.com/NVIDIA/cccl/pull/6153 * Device scan doc fixes by @oleksandr-pavlyk in https://github.com/NVIDIA/cccl/pull/6294 * Scan tests and benchmarks by @oleksandr-pavlyk in https://github.com/NVIDIA/cccl/pull/6355 * [Thrust]: New "sum rows" and "sum columns" examples by @brycelelbach in https://github.com/NVIDIA/cccl/pull/4462 * Added new CUB APIs: `DeviceTransform::Fill` #5526, `DeviceTransform::Generate` #5890, `DeviceTransform::TransformIf` #5198, which are used by `thrust::fill[_n]` #5805, `thrust::uninitialized_fill` #5813, `thrust::generate[_n]` #5807, and `thrust::transform_if`, `thrust::scatter_if` #5952, and non-trivial `thrust::copy` #5954. By @bernhardmgruber. * Made `thrust::tabulate` #6012 use `cub::DeviceTransform` as well by @bernhardmgruber in #5198 ### libcu++ * Added `cuda::barrier` and `cuda::memcpy_async_tx` examples using TMA @bernhardmgruber in #6231 * Waiting on a `cuda::barrier` on SM90+ is now faster and produces less code @bernhardmgruber in #6007 * Improve `cuda::memcpy_async` codegen @bernhardmgruber in #5996 * Improve TMA codegen on sm120 in `cuda::memcpy_async`, `cuda::device::memcpy_async_tx`, `cub::DeviceTransform` @bernhardmgruber in #6362 ### 🤝 cuda.coop * Implement cuda.coop striped_to_blocked. by @tpn in https://github.com/NVIDIA/cccl/pull/4662 ### 🔄 Other Changes * Rework our `signbit` implementation to be potentially constexpr by @miscco in https://github.com/NVIDIA/cccl/pull/5259 * [CUDAX->libcu++] Move ensure_current_device to libcu++ and change the name to ensure_current_context by @pciolkosz in https://github.com/NVIDIA/cccl/pull/5285 * [Version] Update main to v3.2.0 by @github-actions[bot] in https://github.com/NVIDIA/cccl/pull/5286 * Rework our `copysign` implementation to be potentially constexpr by @miscco in https://github.com/NVIDIA/cccl/pull/5287 * Update NVBench by @bernhardmgruber in https://github.com/NVIDIA/cccl/pull/5288 * [CUDAX] Rename async_buffer::change_stream to set_stream and add a test by @pciolkosz in https://github.com/NVIDIA/cccl/pull/5273 * Extend and refactor transform overloads in CUDA system by @bernhardmgruber in https://github.com/NVIDIA/cccl/pull/5238 * Refactor c2h by @bernhardmgruber in https://github.com/NVIDIA/cccl/pull/5205 * Fix inplace_vector out of bounds access for at() by @Jacobfaib in https://github.com/NVIDIA/cccl/pull/5295 * Fix cudax test breaking main by...
Excerpt shown — open the source for the full document.