[all-commits] [llvm/llvm-project] 1d0456: [OpenMP] Avoid checking parent reference count in ...

Joel E. Denny via All-commits all-commits at lists.llvm.org
Sat Jul 10 09:27:44 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1d0456361a4216855e8e7646dc28a372aff07efb
      https://github.com/llvm/llvm-project/commit/1d0456361a4216855e8e7646dc28a372aff07efb
  Author: Joel E. Denny <jdenny.ornl at gmail.com>
  Date:   2021-07-10 (Sat, 10 Jul 2021)

  Changed paths:
    M openmp/libomptarget/src/omptarget.cpp

  Log Message:
  -----------
  [OpenMP] Avoid checking parent reference count in targetDataEnd

The patch has the following benefits:

* Eliminates a lock/unlock of the data mapping table.
* Clarifies the logic that determines whether a struct member's
  device-to-host transfer occurs.  The old logic, which checks the
  parent struct's reference count, is a leftover from back when we had
  a different map interface (as pointed out at
  <https://reviews.llvm.org/D104924#2846972>).

Reviewed By: grokos

Differential Revision: https://reviews.llvm.org/D104924


  Commit: d99f65de2ab1765c588688876641f5018bfe3b53
      https://github.com/llvm/llvm-project/commit/d99f65de2ab1765c588688876641f5018bfe3b53
  Author: Joel E. Denny <jdenny.ornl at gmail.com>
  Date:   2021-07-10 (Sat, 10 Jul 2021)

  Changed paths:
    M openmp/libomptarget/src/device.cpp
    M openmp/libomptarget/src/device.h
    M openmp/libomptarget/src/omptarget.cpp

  Log Message:
  -----------
  [OpenMP] Avoid checking parent reference count in targetDataBegin

This patch is an attempt to do for `targetDataBegin` what D104924 does
for `targetDataEnd`:

* Eliminates a lock/unlock of the data mapping table.
* Clarifies the logic that determines whether a struct member's
  host-to-device transfer occurs.  The old logic, which checks the
  parent struct's reference count, is a leftover from back when we had
  a different map interface (as pointed out at
  <https://reviews.llvm.org/D104924#2846972>).

Additionally, it eliminates the `DeviceTy::getMapEntryRefCnt`, which
is no longer used after this patch.

While D104924 does not change the computation of `IsLast`, I found I
needed to change the computation of `IsNew` for this patch.  As far as
I can tell, the change is correct, and this patch does not cause any
additional `openmp` tests to fail.  However, I'm not sure I've thought
of all use cases.  Please advise.

Reviewed By: jdoerfert, jhuber6, protze.joachim, tianshilei1992, grokos, RaviNarayanaswamy

Differential Revision: https://reviews.llvm.org/D105121


Compare: https://github.com/llvm/llvm-project/compare/8f4e5474de74...d99f65de2ab1


More information about the All-commits mailing list