blockIdy.y and threadIdy.y says undefined


I am trying to add two dimensional array in cuda c++
my global function looks like this

global void addMatrix(int *d_array1, int *d_array2, int d_result)
int j= blockIdx.x
blockDim.x + threadIdx.x;

int i= blockIdy.y*blockDim.y + threadIdy.y;

// rest of the function


but while compiling, an error shows which says blockIdy.y and threadIdy.y are undefined.

Please let me know how can I fix this.


The correct syntax is not:


it should be


likewise for threadIdy.y

They are indeed undefined. You are using incorrect syntax.

the Idx in blockIdx is an abbreviation for Index.

You used Idy instead… Indey is not a word. ;)