每个块的最大线程数 [英] maximum number of threads per block

查看:191
本文介绍了每个块的最大线程数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下信息:

Maximum number of threads per block:           512
Maximum sizes of each dimension of a block:    512 x 512 x 64

这意味着2d中的最大线程数线程块是512x512,它在每个块中给我一个262144个线程?

如果是,那么这是一个很好的做法是在内核中有最少256个线程的这个线程数量?

does this mean that the maximum number of threads in a 2d thread block is 512x512 which gives me a 262144 threads in every block?
if yes, then is it a good practice to have this number of threads in a a kernel of minimum 256 blocks?

推荐答案

不,这意味着每个块的最大线程数为512,

No, it means that the maximum threads per block is 512,

如何将它放在[1 ... 512] x [1 ... 512] x [1 ... 64]。

You can decide how to lay that out over [1 ... 512] x [1 ... 512] x [1 ... 64].

在2D中确定。

对于块大小的决定,很多事情都会考虑,比如一个块需要的内存量, -warp是在硬件上(我不记得如果它总是16在Nvidia硬件)。

As for the deciding on the size of the block, lots of things come into consideration, like the amount of memory a block needs and how big a half-warp is on the hardware (I don't remember if its always 16 on Nvidia hardware).

这篇关于每个块的最大线程数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆