[Openmp-commits] [PATCH] D34701: [openmp-target-tests] OpenMP 4.5 Target data test cases

Andrey Churbanov via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu Nov 2 02:31:46 PDT 2017


AndreyChurbanov added inline comments.


================
Comment at: libomptarget/test/offloading/target_data/test_target_data_if.c:38-40
+        if (c[i] != 0) {
+          errors = 1;
+        }
----------------
Hahnfeld wrote:
> Again thinking about this, the check may be wrong: The OpenMP standard says that the `target data` and `target` constructs execute on the host, if the `if` clause evaluates to false. This check is assuming that it doesn't execute at all, right?
This check looks like a dead code.  The size gets three values - 256 to execute on host, 512 and 758 to execute on device.  Neither of these values is less than 256, so (size < 256) is the same as false.

Maybe the intention was to check all 1024 values, and zeros should hold for (i >= size).


https://reviews.llvm.org/D34701





More information about the Openmp-commits mailing list