[Openmp-commits] [PATCH] D65340: [OpenMP][libomptarget] Add support for close map modifier

Jonas Hahnfeld via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Fri Aug 9 12:30:21 PDT 2019


Hahnfeld requested changes to this revision.
Hahnfeld added a comment.
This revision now requires changes to proceed.

Can you please rebase on top of D66019 <https://reviews.llvm.org/D66019>? Sorry, that'll probably give you some conflicts :-/



================
Comment at: libomptarget/test/unified_shared_memory/close_manual.c:46-52
+// For the initalization of the device.
+#pragma omp target map(tofrom : device_alloc)
+  { device_alloc = 10; }
+
+  // CHECK: device_alloc updated on the device
+  if (device_alloc == 10)
+    printf("device_alloc updated on the device\n");
----------------
gtbercea wrote:
> Hahnfeld wrote:
> > gtbercea wrote:
> > > Hahnfeld wrote:
> > > > Why do we need this?
> > > To initialize the device.
> > This should happen in `__tgt_target_data_begin` which can be a legitimate first directive in a program.
> Yes target data can be a first directive but if there's no target region in the program then the runtime library won't be loaded/initialized. 
Ah, got the intention. Can you please add a comment explaining that we need at least one target region to load a "binary" and make all of the data calls work? And I don't think we need to check that `device_alloc` is correctly transferred, do we? There are other tests for that (plus casting `10` to `void *` looks evil anyway).


Repository:
  rOMP OpenMP

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65340/new/

https://reviews.llvm.org/D65340





More information about the Openmp-commits mailing list