Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

am I reading correctly that your AtomicMin stops only when CAS succeeds?

can you not stop early if extracted value becomes smaller than val?



also, iirc, floats' comparison is compatible with signed integers' comparison due to representation?

so just using cuda's AtomicMin for ints would be enough


Positive 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. :-)




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: