【发布时间】:2011-08-18 23:08:46
【问题描述】:
我在理解 GPU 上的 SIMT 执行时遇到了一些麻烦。到目前为止,我已经将线程放置在“warp”中(例如 32 个线程/warp)。这些线程将属于同一类型并且可以并行运行(但可以分支和独立运行)。
然后我正在阅读的书继续让我感到困惑。 'It is then up to the instruction unit to select warps that are ready to execute their next instruction, and this instruction is then issued to the active threads of the warp. Each SP core executes an instruction for four individual threads of a warp using four clocks'.
选择的架构有 8 个 SP,每个 warp 有 32 个线程。因此,每个 SP 被分配了 4 个线程。为什么不只分配 1 个线程/SP? “使用四个时钟”是什么意思?每条指令是否需要 1 个时钟并执行 4 次(每个线程 1 次)?
我遇到的另一个问题是,如果你有一个带有 32 个线程的扭曲,每个线程都包含一个条件。如果一半分支一条路,另一半分支怎么办?从我读到的,线程执行两个结果?这是如何运作的?即它如何遵守程序规则
【问题讨论】:
标签: gpu