Saturday 3 June 2017

What are the keywords used for finding block id and thread id in CUDA?


           To find block id, we have to use blockIdx.x for id along X axis and blockIdx.y for id along Y axis.

e.g. int id=blockIdx.x;

           To find thread id, we have to use threadIdx.x for id along X axis and blockIdx.y for id along Y axis.

e.g. int id=threadIdx.x;

No comments:

Post a Comment