kar
kar

Reputation: 2805

CUDA max threads in a block

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

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

Upvotes: 17

Views: 21952

Answers (1)

Pavan Yalamanchili
Pavan Yalamanchili

Reputation: 12109

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).

Upvotes: 41

Related Questions