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

Jonas Hahnfeld via Openmp-commits openmp-commits at lists.llvm.org
Wed Mar 23 07:39:41 PDT 2016


Hahnfeld 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;
+  }
+
----------------
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.


http://reviews.llvm.org/D14031





More information about the Openmp-commits mailing list