eyalroz / cuda-kat

CUDA kernel author's tools
BSD 3-Clause "New" or "Revised" License
105 stars 8 forks source link

Use "xxx_index" in dimensioned contexts and "xxx_id" in linearized ones #43

Open eyalroz opened 4 years ago

eyalroz commented 4 years ago

In a 2D or 3D block, the CUDA "thread index" - according to official documentation - is a 3D or 3D entity, while the "thread ID" is its linearization (where x changes fastest, then y, then z).

cuda-kat currently doesn't observe this distinction, due to a bias in favor of work with linear grids. We should make sure it is respected in:

We should also check if there are separate special registers for the dimensioned index and the id; that could be useful.