Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

CUDA: Block and Grid Dimensions

📅 2011-Feb-04 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ cuda ⬩ 📚 Archive

Sometimes the number of possible dimensions of a CUDA block and grid can get confusing. This is not helped by the fact that both of their dimensions is specified by the type dim3.

I try to distinguish their dimensions by the meaning of their words:

Similarly, I also find the global variables blockDim and gridDim very confusing. Instead, I mentally replace blockDim by threads-per-block and gridDim by blocks-per-grid.

© 2022 Ashwin Nanjappa • All writing under CC BY-SA license • 🐘📧