The following rules guarantee an observable completion order for a given pair of memory operations in race-free programs, as seen by all affected threads. If both memory operations are strong flushes, the affected threads are all threads on devices in both of their respective device-sets. If exactly one of the memory operations is a strong flush, the affected threads are all threads on devices in its device-set. Otherwise, the affected threads are all threads.
If two operations are performed by different threads and one happens before the other, then they must be completed as if in that happens before order, as seen by all affected threads, if:
The flush operation can be specified using the flush directive, and is also implied at various locations in an OpenMP program: see Section 15.8.5 for details.
OpenMP programs that:
behave as though operations on shared variables were simply interleaved in an order consistent with the order in which they are performed by each thread. The relaxed consistency model is invisible for such programs, and any explicit flush operations in such programs are redundant.