how many threads can used in one grid 512*65535*65535

When run the Device Query, I get the below information. I wonder that how many block can used in one grid if 512 threads in each block? Could I use 65535*65535 blocks?

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

A little bit confusion, wish can make it clear.



Like you said, the maximum number of threads per block is 512, that’s why no single dimension of the block size is larger than this value.

My guess is that the z-dimension is limited to 64, to make the linear threadID fit into a 24 bit value, but you can easily work around this constraint

by using a linear adressing of the multidimensional space and calculating the corresponding 3D indices within the kernel itself.

I believe the answer to your question to be yes, you should be able to process 65535 x 65535 blocks of 512 threads each.