About thread ids

Hi,

I’m reading “CUDA Fortran Programming Guide and Reference Release 2012”, which in Chaper 2, Section Thread Blocks states:

For a one-dimensional thread block, the thread index is equal to the thread ID. For a two-dimensional thread
block of size (Dx,Dy), the thread ID is equal to (x+Dx(y-1)). For a three-dimensional thread block of size
(Dx,Dy,Dz), the thread ID is (x+Dx(y-1)+Dy(z-1)).

and I think something is wrong specifically with three-dimensional thread blocks, since in a block of size 2x2x2 threads (1, 2, 1) and (1, 1, 2) would both have id 2…

Or I’m misunderstanding something… please tell me about.
Thanks in advance,

Fernando.

The entire paragraph is confusing and potentially misleading. I think we’ll just remove it. There really is no notion of a thread ID that the user has access to without computing it themselves.

The equation is question looks like it is missing parenthesis, should be
x + Dx((y-1)+Dy(z-1))

Thank you for replying.

Actually, I’ve posted this issue as well as other/s, including typos to the e-mail address which appears in the document as the “Technical support” e-mail, and all of them have been included in TPR 18977 (which I cannot see online, I don’t know if such TPRs are available online).

About

I think we’ll just remove it. There really is no notion of a thread ID that the user has access to without computing it themselves.

I agree on removing “ID”, but I think it is useful to maintain the idea of “thread index”, since it could be used for computing thread-specific code. Just my idea, though.

Thank you again,

Fernando.