How fast to access "threadIdx" ?

Hi!

I just wonder if there is any need (under performance aspects) for writing

int tId = threadIdx.x

or if it is ok to just use threadIdx.x everywhere in the code, e.g. by a define

#define TID threadIdx.x

(of course we cannot assign a value to TID then)

Does anybody know about this ?

The thread index is already stored in a register automatically, so there should be no speed difference between the two versions. See:

http://forums.nvidia.com/index.php?showtop…ndpost&p=314099

Thank you for the link. There the exact details are given. Sorry, but I didn’t found the other thread by the search-function.