gpt4 book ai didi

c++ - CUDA 主动扭曲与常驻扭曲

转载 作者:行者123 更新时间:2023-11-28 01:53:47 25 4
gpt4 key购买 nike

CUDA 中的占用定义为

occupancy = active_warps / maximum_active_warps

resident CUDA warp 和active 之间有什么区别?

根据我在网络上的研究,一个 block 似乎在其整个执行期间都驻留在 SM 上(即与其寄存器/共享内存文件一起分配)。与“活跃”有区别吗?

如果我有一个使用很少寄存器和共享内存的内核..这是否意味着我可以拥有 maximum_active_warps 驻留 block 并实现 100% 占用,因为占用仅取决于寄存器的数量/使用共享内存?

最佳答案

What is the difference between a resident CUDA warp and an active one?

在这种情况下大概什么都没有。

From my research on the web it seems that a block is resident (i.e. allocated along with its register/shared memory files) on a SM for the entire duration of its execution. Is there a difference with "being active"?

现在您已经从询问扭曲切换到询问 block 。但同样,在这种情况下,不,您可以认为它们是相同的。

If I have a kernel which uses very few registers and shared memory.. does it mean that I can have maximum_active_warps resident blocks and achieve 100% occupancy since occupancy just depends on the amount of register/shared memory used?

不是,因为扭曲和 block 不是一回事。正如您自己引用的那样,占用率是根据扭曲而不是 block 定义的。 warp 的最大数量固定为 48 或 64,具体取决于您的硬件。最大块数固定为 8、16 或 32,具体取决于硬件。有两个不相同的独立极限。两者都会影响给定内核可以实现的有效占用率。

关于c++ - CUDA 主动扭曲与常驻扭曲,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41920998/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com