[Openmp-commits] [PATCH] D65001: [OpenMP][libomptarget] Add support for unified memory for regular maps

Narayanaswamy, Ravi via Openmp-commits openmp-commits at lists.llvm.org
Mon Jul 29 13:13:40 PDT 2019


Section 3.6.1 :   Unless unified_address clause appears on a requires directive in the compilation unit,
pointer arithmetic is not supported on the device address returned by omp_target_alloc.

-----Original Message-----
From: Gheorghe-Teodor Bercea via Phabricator [mailto:reviews at reviews.llvm.org] 
Sent: Monday, July 29, 2019 12:08 PM
To: gheorghe-teod.bercea at ibm.com; a.bataev at hotmail.com; jdoerfert at anl.gov; hahnjo at hahnjo.de; alexe at us.ibm.com; caomhin at us.ibm.com; Rokos, Georgios <georgios.rokos at intel.com>
Cc: mgorny at gentoo.org; zhang.guansong at gmail.com; openmp-commits at lists.llvm.org; deachempat at cray.com; ron.lieberman at amd.com; jatin.bhateja at gmail.com; lildmh at gmail.com; Gregory.Rodgers at amd.com; acjacob at us.ibm.com; Narayanaswamy, Ravi <ravi.narayanaswamy at intel.com>
Subject: [PATCH] D65001: [OpenMP][libomptarget] Add support for unified memory for regular maps

gtbercea marked an inline comment as done.
gtbercea added inline comments.


================
Comment at: libomptarget/src/omptarget.cpp:247-249
+    // TODO: Check if this is correct
+    bool IsInUseDevicePtrClause = arg_types[i] & OMP_TGT_MAPTYPE_TARGET_PARAM &&
+        arg_types[i] & OMP_TGT_MAPTYPE_RETURN_PARAM;
----------------
Hahnfeld wrote:
> gtbercea wrote:
> > Hahnfeld wrote:
> > > grokos wrote:
> > > > This is correct, with one little exception. Although the OpenMP standard does not mandate it, upstream clang supports `use_device_ptr` on pointers which are struct members. Because they are struct members, they are not marked with `TARGET_PARAM` (only the combined entry is considered a target parameter, not the individual members). On the other hand, they are marked with `PTR_AND_OBJ` and have some value in the `MEMBER_OF` bits.
> > > > 
> > > > Once again, it's a non-standard extension so we are free to decide whether to support it or not in the unified shared memory scenario.
> > > Can we please first answer my question why we need to care about the existence of `use_device_ptr`? Why does it make a difference for unified shared memory?
> > Because use_device_ptr implies the use of a true device pointer and again that needs to be respected even unified memory is used.
> Where is that in the spec?
The pointers returned by omp_target_alloc and accessed through use_device_ptr are guaranteed to be pointer values that can support pointer arithmetic while still being native device pointers. (Section 2.4 page 61 bottom).


Repository:
  rOMP OpenMP

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

https://reviews.llvm.org/D65001





More information about the Openmp-commits mailing list