title: get global ThreadId in 2 dimensions in OpenCl
body: <p>How can i get the global threadId in 2 dimensions in OpenCL? 
  I know that for 1 dimension, the formula is:</p>
  
  <pre><code> int global_id = get_global_id(1) * get_global_size(0) + get_global_id(0);
  </code></pre>
  
  <p>But if i allocate like this:</p>
  
  <pre><code>size_t block_size[] = {2,2}
  size_t grid_size[] = {35,20}
  </code></pre>
  
  <p>The above formula fails, giving indexes only from 0 to 35*20.
  The indexes should go from 0 to 35*40*2*2.</p>
  
  <p>Can you recommend any good documentation or writings that could give me the intuition to understand how all of this works? 
  Thanks!</p>