Are the grid lengths of the x, y, and z dimensions always the same?
Can you be more specific? Do you mean does gridDim.x == gridDim.y == gridDim.z? The answer to that is no. You can pick anything you want, within the limits given in Appendix A of the CUDA programming guide.
With that said, why would it be useful to have a grid with different dimensions like that?
Just as an organizational convenience for your code. If each block were computing a pixel in an output image, then it might be nice for blockIdx.x and blockIdx.y to correspond to the pixel coordinates.
Personally, I’ve never needed this feature. I only use 1D grids (gridDim.y = gridDim.z = 1).
thanks, I believe I understand now