[Openmp-commits] [PATCH] D104555: [OpenMP][Offloading] Guard data movement from host to device with mapping table lock

Shilei Tian via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Fri Jun 18 11:00:44 PDT 2021


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

This patch tries to partially fix one of the two data race issues reported in
[1] by guarding the data movement from host to device with mapping table lock.
Additional discussion can also be found in D104418 <https://reviews.llvm.org/D104418> [2], which will also be
refined to fix another data race problem.

This fix is pretty straightforward: it makes sure that when a target task looks
into the mapping talbe, the data movement of corresponding entry has at least
been *issued*. Note that the second data race issue will not be fixed because
the issue of data movement doesn't mean the data will be on the device. That's
why we need to introduce event mechanism to do that. But the good thing is, if a
target doesn't support async data movement, its problem is solved because the
issue of data movement equals to the finish of data movement in this case.

Reference:
[1] https://bugs.llvm.org/show_bug.cgi?id=49940
[2] https://reviews.llvm.org/D104418


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D104555

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: D104555.353054.patch
Type: text/x-patch
Size: 13763 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20210618/53483beb/attachment-0001.bin>


More information about the Openmp-commits mailing list