17

I have a confusion from the programming guide . It states the following:

  • maxThreadsPerBlock: 512
  • maxThreadsDim: 512, 512, 64 .

When max number of threads in a block can be 512, how can the max thread dimension be 512*512*64 ?

Pavan Yalamanchili
  • 12,021
  • 2
  • 35
  • 55
kar
  • 2,505
  • 9
  • 30
  • 32
  • 1
    http://stackoverflow.com/questions/2392250/understanding-cuda-grid-dimensions-block-dimensions-and-threads-organization-si – Sergey Vedernikov Feb 21 '11 at 05:52
  • what Sergey said plus: http://developer.download.nvidia.com/compute/cuda/3_1/toolkit/docs/NVIDIA_CUDA_C_ProgrammingGuide_3.1.pdf – Dave O. Feb 21 '11 at 15:49

1 Answers1

41

Maximum threads in X direction: 512 (1024 for compute capability >= 2.0)

Maximum threads in Y direction: 512 (1024 for compute capability >= 2.0)

Maximum threads in Z direction: 64

So you can launch the following block configurations (compute capability >= 2.0 shown in parentheses)

  • 512 x 1 x 1 (1024 x 1 x 1)

  • 128 x 2 x 2 (256 x 2 x 2)

  • 1 x 512 x 1 (1 x 1024 x 1)

  • 1 x 8 x 64 (2 x 8 x 64)

  • 2 x 4 x 64 (4 x 4 x 64)

and so on.

The total number of threads in a block must not exceed 512 (for compute capability < 2.0), or 1024 (for compute capability >= 2.0).

Pavan Yalamanchili
  • 12,021
  • 2
  • 35
  • 55
  • Reference: https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#features-and-technical-specifications – Rufus Sep 09 '20 at 09:34