0

I have 64 threads in a block and I am using atomicMin() to get the minimum of a certain variable among these threads. Ideally I would also want to know, somehow, the id of the thread that had the minimum value. Is there an efficient way to do it?

tigeradol
  • 259
  • 2
  • 16
  • 2
    Your question is basically a duplicate of [this one](http://stackoverflow.com/questions/18432951/can-we-know-which-block-thread-find-the-minimum-value-of-the-device-memory). An answer like [this one](http://stackoverflow.com/questions/31706599/how-to-perform-reduction-on-a-huge-2d-matrix-along-the-row-direction-using-cuda) contains an example of a parallel reduction that finds both a maximum and and index (per row, in this case) – Robert Crovella Nov 11 '15 at 15:56
  • 1
    I'm going to mark this as a duplicate if there are no objections. – Robert Crovella Nov 12 '15 at 02:48

0 Answers0