title: CUDA in-place transpose doesn't complete transpose total matrix
body: <p>I've written the CUDA code below. It's supposed to transpose a matrix using tiling blocks, and the code works when using small values, but when using, for example:
  TILE = 32, matrix 128 x 128, it doesn't complete the transpose, it stops after 96. In host this is my dimension thread/block</p>
  
  <pre><code>dim3 dimGrid((nEven + TILE_DIM - 1) / TILE_DIM, (nEven + TILE_DIM - 1) / TILE_DIM); 
  dim3 dimBlock(TILE_DIM, TILE_DIM);
  </code></pre>
  
  <p>where I let the threads number == to tile block number,
  the global code is simple and it should theoretically work:</p>
  
  <pre><code>__global__ void transposeMain( int *idata)
  {
      __shared__ int tile2[TILE_DIM][TILE_DIM];
  
      int yyy = blockIdx.y * TILE_DIM ; // col values (0,32,64,96)
      int xxx = blockIdx.x * TILE_DIM ; // row values (0,32,64,96)
  
      if (xxx &lt; nEven &amp;&amp; yyy &lt; nEven) 
      {
          tile2[threadIdx.x][threadIdx.y] = idata[(threadIdx.x + xxx)*nEven + (threadIdx.y + yyy)];
  
          __syncthreads();
  
          idata[(threadIdx.y + yyy)*nEven + (threadIdx.x + xxx)] = tile2[threadIdx.x][threadIdx.y];
  
      }
  }
  </code></pre>
  
  <p>Any idea what might be the problem?</p>