rapidsai / raft

RAFT contains fundamental widely-used algorithms and primitives for machine learning and information retrieval. The algorithms are CUDA-accelerated and form building blocks for more easily writing high performance applications.
https://docs.rapids.ai/api/raft/stable/
Apache License 2.0
737 stars 188 forks source link

[BUG] myAtomicMax/myAtomicMin are not fully atomic #252

Open achirkin opened 3 years ago

achirkin commented 3 years ago

Describe the bug Just looking at the code of myAtomicMax, it looks like this operation may return the result after some other thread writes into the memory location. An easy fix would be to return the actual old or new value from myAtomicReduce. Not sure if this can hurt anybody for now, but it's probably worth fixing.

Expected behavior myAtomicMax / myAtomicMin should consistently return the old value to comply with the intrinsic versions.

divyegala commented 3 years ago

@achirkin could you perhaps use the atomics provided in https://github.com/rapidsai/raft/blob/branch-21.08/cpp/include/raft/device_atomics.cuh? We would like to deprecate/remove conflicting versions of these very soon

achirkin commented 3 years ago

Sure, thanks for pointing that out!

github-actions[bot] commented 2 years ago

This issue has been labeled inactive-90d due to no recent activity in the past 90 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed.

github-actions[bot] commented 2 years ago

This issue has been labeled inactive-30d due to no recent activity in the past 30 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed. This issue will be labeled inactive-90d if there is no activity in the next 60 days.