blockIdy.y and threadIdy.y says undefined

Hello,

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.

Thanks

The correct syntax is not:

blockIdy.y

it should be

blockIdx.y

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