title: Can CUDA do argmax?
body: <p>Question says it all; </p>
  
  <p>Assuming each threads are doing something like</p>
  
  <pre><code>value=blockDim.x*blockIdx.x+threadIdx.x;
  result=f(value);
  </code></pre>
  
  <p>where f is a device function, its easy enough to find the max result by adding an atomicMax() call, but how could you find out what the value was?</p>