Home Knowledge Base GPU Cooperative Groups

GPU Cooperative Groups is the CUDA programming model extension that provides flexible, hierarchical thread grouping and synchronization primitives beyond the fixed thread-block model — enabling grid-level synchronization, dynamic sub-warp partitioning, and multi-GPU cooperative launches that allow algorithm designers to express synchronization patterns matching their computation's natural structure rather than being forced into the rigid block/grid hierarchy.

Why Cooperative Groups Exist

Classic CUDA provides two synchronization scopes: __syncthreads() within a thread block, and kernel launch boundaries for grid-level synchronization. This forces algorithms requiring global synchronization to split into multiple kernel launches (expensive: 5-20 μs overhead each) or use unreliable atomic-based ad-hoc synchronization. Cooperative Groups fills the gap.

Group Hierarchy

Tiled Partition

Split a group into fixed-size tiles for warp-level algorithms:

auto warp = cooperative_groups::tiled_partition<32>(this_thread_block());
auto half_warp = cooperative_groups::tiled_partition<16>(warp);
int sum = half_warp.shfl_down(val, 8) + val;  // 16-thread reduction

This enables portable warp-level algorithms that work with any tile size (1, 2, 4, 8, 16, 32).

Use Cases

Cooperative Groups is the synchronization abstraction that unlocks algorithm patterns impossible in the classic CUDA model — providing the flexibility to synchronize at any granularity from sub-warp to multi-GPU, enabling persistent kernels and global-barrier algorithms that were previously impractical.

gpu cooperative groupscooperative kernel launchthread block clustergrid level synchronizationcooperative groups cuda

Explore 500+ Semiconductor & AI Topics

From EUV lithography to CUDA optimization — search the full knowledge base or chat with our AI assistant.