![]() Intrinsic groups defined by the CUDA launch API (e.g., thread blocks).Data types representing groups of cooperating threads and their properties.The Cooperative Groups programming model consists of the following elements: Explicit groups and synchronization help make code less brittle, reduce restrictions on compiler optimization, and improve forward compatibility. Explicit groups make these requirements explicit, reducing the chances of misusing the library function. Consider a library function that imposes requirements on its caller. The expression of groups as first-class program objects improves software composition: collective functions can take an explicit argument representing the group of participating threads. These primitives enable new patterns of cooperative parallelism within CUDA, including producer-consumer parallelism and global synchronization across the entire thread grid or even multiple GPUs. It also provides host-side APIs to launch grids whose threads are all guaranteed to be executing concurrently to enable synchronization across thread blocks. It provides CUDA device code APIs for defining, partitioning, and synchronizing groups of threads. ![]() The Cooperative Groups programming model describes synchronization patterns both within and across CUDA thread blocks. However, CUDA programmers often need to define and synchronize groups of threads smaller than thread blocks in order to enable greater performance, design flexibility, and software reuse in the form of “collective” group-wide function interfaces. Historically, the CUDA programming model has provided a single, simple construct for synchronizing cooperating threads: a barrier across all threads of a thread block, as implemented with the _syncthreads() function. Cooperative Groups extends the CUDA programming model to provide flexible, dynamic grouping of threads. CUDA 9 introduces Cooperative Groups, which aims to satisfy these needs by extending the CUDA programming model to allow kernels to dynamically organize groups of threads. Making synchronization an explicit part of the program ensures safety, maintainability, and modularity. The granularity of sharing varies from algorithm to algorithm, so thread synchronization should be flexible. To share data, the threads must synchronize. In efficient parallel algorithms, threads cooperate and share data to perform collective computations.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |