[Openmp-commits] [PATCH] D104382: [OpenMP][Offloading] Refined return value of `DeviceTy::getOrAllocTgtPtr`

Shilei Tian via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Wed Jun 16 06:55:36 PDT 2021


tianshilei1992 created this revision.
tianshilei1992 added reviewers: ABataev, JonChesterfield, jhuber6, jdoerfert.
Herald added subscribers: guansong, yaxunl.
tianshilei1992 requested review of this revision.
Herald added subscribers: openmp-commits, sstefan1.
Herald added a project: OpenMP.

`DeviceTy::getOrAllocTgtPtr` just returns a target pointer. In addition,
two bool values (`IsNew` and `IsHostPtr`) are passed by reference to make the
change in the function available in callee.

In this patch, a struct, which contains the target pointer, two flags, and an
iterator to the map table entry corresponding to the queried host pointer, will
be returned. In addition to make the logic clearer regarding the two bool values,
this paves the way for the next patch to fix the data race in `bug49334.cpp` by
attaching an event to the map table entry (and that's why we need the iterator).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D104382

Files:
  openmp/libomptarget/src/device.cpp
  openmp/libomptarget/src/device.h
  openmp/libomptarget/src/omptarget.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104382.352426.patch
Type: text/x-patch
Size: 12052 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20210616/f0b10f2d/attachment-0001.bin>


More information about the Openmp-commits mailing list