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

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

[C++][SFML 2.2] Strange Performance Issues - Moving Mouse Lowers CPU Usage -

ios - Possible to get UIButton sizeThatFits to work? -