1 Reply Latest reply on Sep 30, 2010 6:23 AM by himanshu.gautam

    atomic min to store id of tuple (value, id) with lowest value

    Tasp

      I need a kernel that computes the id with minimal value from tuples (value, id).
      How can I do that?

      Only idea i have is combine the values:

      32bit: 16bit = value, 16bit = id

      and use the atomic_min function, first local, then global of course.
      If value is equal lower id would win. 16bit precision would be enough for me.

      Is there a better way?