CUDA变量是什么意思?
Maximum number of threads per multiprocessor: 2048
Maximum number of threads per block: 1024
Maximum sizes of each dimension of a block: 1024 x 1024 x 64
Maximum sizes of each dimension of a grid: 2147483647 x 65535 x 65535
例如,Maximum sizes of each dimension of a grid,
表示有2147483647个网格。每个网格包含65535块?
不,这些是您可以使用的最大HW限制。块的最大尺寸为1024x1024x64,但每个块的线程限制为1024,因此可以使用块尺寸为1024x1x1或32x32x1等。你不能拥有更多,但你可以使用更少。
一般来说,这取决于你,你如何设置你的网格块尺寸(在限制内),这取决于你需要什么。最基本的层次结构是,你有一个方块网格。每个块包含线程。如果网格尺寸为2x2x2,块尺寸为16x1x1,则有8个块,每个块有16个线程,因此有128个线程在运行。
CUDA有很好的文档,所以我建议你从那里开始。