Saturday, 3 June 2017

What are keywords used for block size and grid size in CUDA?

           In CUDA, to find block size (number of threads in one block), we have to use blockDim.x for finding number of threads along X axis in that block while blockDim.y for finding number of threads along Y axis in that block.

e.g. int size=blockDim.x;

           To find grid size (number of blocks in one grid), we have to use gridDim.x for finding number of blocks along X axis in that grid while gridDim.y for finding number of blocks along Y axis in that grid.

e.g. int size=gridDim.x;

No comments:

Post a Comment