您的位置:首页 > 其它

cuda wrap执行方式

2017-04-11 16:11 141 查看
原文:

At every instruction issue time, the SIMT unit selects a warp that is ready to execute and issues the next instruction to the active threads of the warp. A warp executes one common instruction at a time, so full efficiency is realized when all threads of
a warp agree on their execution path. If threads of a warp diverge via a data-dependent conditional branch, the warp serially executes each branch path taken, disabling threads that are not on that path, and when all paths complete, the threads converge back
to the same execution path. Branch divergence occurs only within a warp; different warps execute independently regardless of whether they are executing common or disjointed code paths.

意思:

在每一个指令执行的时间,SIMT(单指令多线程)单元选择一个可以执行的wrap和准备执行下条指令.一个wrap一次执行一个共有指令, 所以最有效率的显然是一个wrap内的所有线程具有相同的执行路径.这是因为如果一个wrap内的线程依赖数据出现了条件分支,那么这个wrap会顺序执行每一个分支的路径,而在执行某一个分支路径的时候,不在这个分支上的线程将不会被激活执行(暂停),当所有的分支都被执行完成后,线程会重新聚集回到相同的执行路径上.但分支的概念只在一个wrap内;不同wrap的执行是独立的不管他们是否正在执行共有或者不同的代码路径.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: