I started learning OpenMP and found a directive #pragma omp atomic.
I have a basic understanding of the atomicity of C ++ 11 and know that you can pass a parameter memory_orderto the atomization method. Correct me if I am wrong, but I think that this allows you to use atomics as a synchronization point if you use memory_order_seq_cst, for example.
Some less restrictive memory order, for example memory_order_relaxed, just make sure atom operations are synchronized and visible to others. He knows nothing about other memory updates.
I would like to know what memory order is used by the OpenMP atomic directive. Will it only synchronize access to atomic or will it act as a memory synchronization point?
I assume this will be more like memory_order_relaxed, because it criticalprovides full synchronization here.
I welcome any good explanation / information. Thank.
source
share