title: creation 2D grid in CUDA for GPGPU using C++
body: <p>I am trying to extend my grid from a 1d to a 2d grid. Is there any way to do this?</p>
  
  <p>Here is my current code: </p>
  
  <pre><code>int idx = threadIdx.x + blockDim.x * blockIdx.x;
  </code></pre>
  
  <p>In the <code>#include</code> list I have these definitions:</p>
  
  <pre><code>#define BLOCKS_PER_GRID 102
  
  #define THREADS_PER_BLOCK 1024
  </code></pre>