title: OpenCL efficient way to group a lower triangular matrix
body: <p>I'm sure someone has come across this problem before, basically I have a 2D optimisation grid NxM in size, with the constraint that n_i &lt;= m_i , i.e I only want to calculate the pairs in the lower triangular section of the matrix. At the moment I naively just implement all NxM combinations in a N local groups of M work groups (and then use localGroupID and workGroupID to identify the pair), and then return -inf if the constraint fails to save computation.</p>
  
  <p>But is there a better way to set up the threads and index them so I only need to generated (NXM)/2 threads rather than the full NxM.</p>
  
  <p>Many thanks
  Sam</p>