线程块网格Thread Block Grid
线程块网格是 CUDA 编程模型 线程组层次结构的最高层级(左图)。它们映射到多个 流式多处理器 (Streaming Multiprocessor) 上(右图,底部)。改编自 NVIDIA 的 CUDA Refresher: The CUDA Programming Model 和 NVIDIA CUDA C++ Programming Guide 中的图表。
当启动 CUDA 内核 (kernel) 时,会创建一个称为线程块网格的 线程 (thread) 集合。网格可以是一维、二维或三维的。它们由多个 线程块 (thread block) 组成。
在 内存层次结构 (memory hierarchy) 中对应的级别是 全局内存 (global memory)。
线程块 (thread block) 实际上是独立的计算单元。它们以并发方式执行,即执行顺序不确定,范围从在只有一个流式多处理器 (Streaming Multiprocessor) 的 GPU 上完全顺序执行,到在有足够资源同时运行所有线程块的 GPU 上完全并行执行。
英文原文(Modal GPU Glossary)
(left). They map onto multiple Streaming Multiprocessors (right, bottom). Modified from diagrams in NVIDIA's CUDA Refresher: The CUDA Programming Model and the NVIDIA CUDA C++ Programming Guide.](themed-image://cuda-programming-model.svg)
When a CUDA kernel is launched, it creates a collection of threads known as a thread block grid. Grids can be one, two, or three dimensional. They are made up of thread blocks.
The matching level of the memory hierarchy is the global memory.
Thread blocks are effectively independent units of computation. They execute concurrently, that is, with indeterminate order, ranging from fully sequentially in the case of a GPU with a single Streaming Multiprocessor to fully in parallel when run on a GPU with sufficient resources to run them all simultaneously.
相关词条
本词条改编自 Modal GPU Glossary(CC BY 4.0)· 中文翻译 miter6/gpu-glossary-zh,MAE 整理排版。