user1994164
user1994164

Reputation: 11

blockIdx (and threadIdx) in Cuda

Why is the Cuda variable 'blockIdx' called blockIdx instead of just blockId? It seems confusing since you can have both blockIdx.x and blockIdx.y, and since it's just the ID of the block, what's the 'x' all about? Same with threadIdx.

Just starting to get into Cuda and was trying to explain to someone how blocks and threads work and we both thought it was a weird/confusing naming convention.

Upvotes: 0

Views: 954

Answers (1)

CygnusX1
CygnusX1

Reputation: 21778

Common shortcuts:

  • id - Identifier
  • idx - Index

in CUDA you talk about "block index" and "thread index", hence the shortcut Idx.

Upvotes: 8

Related Questions