[Openmp-commits] [PATCH] D62397: [OPENMP][NVPTX]Relax flush directive.

Alexey Bataev via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Fri May 31 16:51:27 PDT 2019

ABataev marked 2 inline comments as done.
ABataev added inline comments.

Comment at: libomptarget/deviceRTLs/nvptx/test/parallel/flush.c:18
+      flag = 1;
+/* Flush flag to ensure that thread 1 sees S-21 the change */
+#pragma omp flush(flag)
grokos wrote:
> S-21? Typo?
Yes, this is slightly reworked code from OpenMP Examples document and I forgot to remove this when copied the example.

Comment at: libomptarget/deviceRTLs/nvptx/test/parallel/flush.c:28
+      // CHECK: data=42.
+      /* Values data will be 42, value of flag still undefined */
+      printf("data=%d.\n", data);
grokos wrote:
> "Values" --> "Value of data". Also, why is the value of "flag" undefined at this point?
as I understand, it happens because the compiler is free to reorder read/write ops in any order without explicitly provided ordering. That's why flag can be undefined here.

  rOMP OpenMP



More information about the Openmp-commits mailing list