blockIdx.z == 0 or 1?

If I set the following;

z = threadIdx.z + blockIdx.z* blockDim.z

in kernel, I thought

z = threadIdx.z

because blockIdx.z = 0.

Then I read an article that says blockIdx.z is always 1.

Any comments?

Thanks in advance.

[font=“Courier New”]blockDim.z[/font] is always one, implying that [font=“Courier New”]blockIdx.z[/font] is always 0.

[font=“Courier New”]blockDim.z[/font] is always one, implying that [font=“Courier New”]blockIdx.z[/font] is always 0.

Oh, shoot…yes. the dimension for grid is always two dimension with dim.z = 1 always…

Thanks.

Oh, shoot…yes. the dimension for grid is always two dimension with dim.z = 1 always…

Thanks.