4 ms·
am I reading correctly that your AtomicMin stops only when CAS succeeds? can you not stop early if extracted value becomes smaller than val?
by konstantinua00 3y ago
am I reading correctly that your AtomicMin stops only when CAS succeeds?
can you not stop early if extracted value becomes smaller than val?
- konstantinua00 3y agoalso, iirc, floats' comparison is compatible with signed integers' comparison due to representation? so just using cuda's AtomicMin for ints would be enough
- Sesse__ 3y agoPositive finite floats compare like ints. If you can have negative values, things get slightly more complicated, since they use sign-magnitude (you basically shift the sign bit to the right and use that as an XOR mask on all the other bits). If you need to care about -0.0 == +0.0 and NaN != NaN, most bets are off. :-)