CUDA变量的含义是什么?

CUDA变量的含义是什么?,cuda,gpu,Cuda,Gpu,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 6

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

例如,
网格每个维度的最大大小,
是否意味着有2147483647个网格。每个网格包含65535个块?

不,这些是您可以使用的最大硬件限制。块的最大尺寸为1024x1024x64,但每个块的线程限制为1024,因此可以使用块尺寸1024x1x1或32x32x1等。不能有更多,但当然可以使用更少

通常,这取决于您,如何设置栅格a块尺寸(在限制范围内),这取决于您需要什么。最基本的层次结构是,你有一个由块组成的网格。每个块都包含线程。因此,如果网格尺寸为2x2x2,块尺寸为16x1x1,则有8个块,每个块有16个线程,因此有128个线程在运行

CUDA有一个很好的文档,所以我建议你开始