2D exern'ed shared memory

Is there a way to do the following

extern __shared__ int k[][]


Yes there is, and what you have written is the correct way to do it. You only need to compute indices into k, which will be based either on the execution block dimensions, or arguments you pass into the kernel.

do you mean that I have to do the following:

k[x + blockDim.x * y]

My intention is have something simple by doing: