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

Sergio Pino via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Sun Aug 13 13:27:44 PDT 2017


sergiop marked 8 inline comments as done.
sergiop added a comment.

Hi Jonas,

We addressed your comments about the code + removed the fortran file (you're right, sorry about that). I'm submitting an update to the patch.

Thank you for the time. Best



================
Comment at: libomptarget/test/offloading/target_data/test_target_data_map_classes.cpp:42-43
+      // assign device array ptr to device obj
+      int *tmp_h_array = obj->h_array;
+      obj->h_array = array;
+      int tmp = 0;
----------------
Hahnfeld wrote:
> I don't really understand the purpose of this test: Wouldn't it be more intuitive if the user hadn't to worry about how the array got there? What would happen if mapping `obj->h_array` directly, would compiler and runtime perform this work?
Unfortunately, the mapping is a shallow copy of the object. This means that the address of the array is not translated automatically.


================
Comment at: libomptarget/test/offloading/target_data/test_target_data_map_devices.c:130
+        else if (dev >= real_num_dev) {
+          // allows implementations that map extra devices to the host
+          extra_on_host = 1;
----------------
Hahnfeld wrote:
> Does this really work with libomptarget? If so, is this mandated by the standard and do we want to test this?
In the spec there is not restriction about assigning computation/data movement to a device that has an id higher than the number of actual devices. 


https://reviews.llvm.org/D34701





More information about the Openmp-commits mailing list