# About thread ids

**URL:** <https://forums.developer.nvidia.com/t/about-thread-ids/133280>\
**Category:** Legacy PGI Compilers (archived)\
**Created:** [October 18, 2012, 12:16pm UTC](https://forums.developer.nvidia.com/t/about-thread-ids/133280 "2012-10-18T12:16:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fernando1](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@fernando1](https://forums.developer.nvidia.com/u/fernando1)\
**Post date:** [October 18, 2012, 12:16pm UTC](https://forums.developer.nvidia.com/t/about-thread-ids/133280/1 "2012-10-18T12:16:02Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![brentl](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@brentl](https://forums.developer.nvidia.com/u/brentl)\
**Post date:** [October 23, 2012, 6:28pm UTC](https://forums.developer.nvidia.com/t/about-thread-ids/133280/2 "2012-10-23T18:28:16Z")

</div>

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))

---

<div class="post-metadata">

**Author:** ![fernando1](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@fernando1](https://forums.developer.nvidia.com/u/fernando1)\
**Post date:** [October 24, 2012, 6:55pm UTC](https://forums.developer.nvidia.com/t/about-thread-ids/133280/3 "2012-10-24T18:55:13Z")

</div>

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.
