title: Thrust CUDA find maximum per each group(segment)
body: <p>My data like</p>
  
  <pre><code>value = [1, 2, 3, 4, 5, 6]
  key =   [0, 1, 0, 2, 1, 2]
  </code></pre>
  
  <p>I need to now maximum(value and index) per each group(key).
  So the result should be</p>
  
  <pre><code>max = [3, 5, 6]
  index = [2, 4, 5]
  key = [0, 1, 2]
  </code></pre>
  
  <p>How can I get it with cuda thrust?
  I can do sort -> reduce_by_key but it's not really efficient. In my case vector size > 10M and key space ~ 1K(starts from <code>0</code> without gaps).</p>