[Openmp-commits] [PATCH] D14031: [OpenMP] Initial implementation of OpenMP offloading library - libomptarget.

Samuel Antao via Openmp-commits openmp-commits at lists.llvm.org
Wed Mar 23 07:48:19 PDT 2016


sfantao added inline comments.

================
Comment at: libomptarget/src/omptarget.cpp:723-726
@@ +722,6 @@
+  DeviceTy &Device = Devices[device_id];
+  if (!Device.IsInit) {
+    DP("uninit device: ignore");
+    return;
+  }
+
----------------
Hahnfeld wrote:
> sergos wrote:
> > Hahnfeld wrote:
> > > I think this assumption may be wrong: The standard defines that each device has an initial data environment (section 1.4.2).
> > > 
> > > Therefore a `#pragma omp target update` may be a first (and valid) statement which means that it has to be init here as well. Currently the library will in such a case return at this point and ignore the data transfer.
> > not quite relevant. the initial data environment should be initialized at the point of __tgt_register_lib() call that should prepend any data/control transfer to/from target. that's why we can say the target image was not initialized yet.
> I think the plan was to lazily initialize the device once it is really needed.
> 
> I support this because there may be more libs registered than actually used. So it would be wasted to initialize all of their devices and transfer data to them.
I agree with Jonas, we should allow the device to be initialized in target update so that we only copy the data for that device and not other devices that may not be used at all by the application. I'll fix this.


http://reviews.llvm.org/D14031





More information about the Openmp-commits mailing list