is it atomic for writing a struct to same global memory location in CUDA? -
for example:
struct point { int x, int y; }; if threads write own point same location in global memory in same time, possible final result point in location has x value of thread , y value of thread b?
this question closely related concurrent writes in same global memory location , is global memory write considered atomic in cuda?
[this answer copied comment should have been answer.]
is possible final result point in location has x value of thread , y value of thread b?
yes. avoid such scenario need write point single atomic value (ie, reinterpret point double or int64 , use atomic set).
Comments
Post a Comment