My main question is if it is possible to create bit-field in global memory.

Now I know for various reasons Khronos group rejected bit-fields, so only way is to "emulate" them with bigger data types. The most suitable is probably byte (uchar), so I would use byte-field as storage, but treat it as bit-field with some bitwise magic.

The problem is how to access that data storage correctly. Because there's no synchronization at global level, I can't read & write to same buffer in single kernel run.. it could mess the data (At least I think.. I may read the value and right away other item would write there, making my recently read item "expired"). So reading the byte, writing at desired bit and writing byte back could result in error.

I can come up with only one solution - to write only that one bit and leave others untouched, but I don't think that's possible in current hardware.

Of course one can simply use bytes as bits, but with small memory sizes and even more limited buffer sizes, their number may be insufficient.

Any suggestions? I would also appreciate if someone has different idea how to pack results that consist only of "true" and "false".