This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP][OpenACC] Implement `ompx_hold` map type modifier extension in runtime (2/2)
ClosedPublic

Authored by jdenny on Jul 21 2021, 4:36 PM.

Details

Summary

This patch implements OpenMP runtime support for an original OpenMP
extension we have developed to support OpenACC: the ompx_hold map
type modifier. The previous patch in this series, D106509, implements
Clang support and documents the new functionality in detail.

Diff Detail

Event Timeline

jdenny created this revision.Jul 21 2021, 4:36 PM
jdenny requested review of this revision.Jul 21 2021, 4:36 PM
jdenny updated this revision to Diff 361034.Jul 22 2021, 5:12 PM
jdenny retitled this revision from [OpenMP][OpenACC] Implement `hold` map type modifier extension in runtime (2/2) to [OpenMP][OpenACC] Implement `ompx_hold` map type modifier extension in runtime (2/2).
jdenny edited the summary of this revision. (Show Details)

Updated for changes in D106509:

  • Renamed hold to ompx_hold.
  • Added -fopenmp-extensions to tests. Without it, Clang doesn't recognize ompx_hold.
jdenny updated this revision to Diff 365858.Aug 11 2021, 3:06 PM

Rebased.

jdenny updated this revision to Diff 367915.Aug 20 2021, 3:14 PM

Rebased. Ping.

grokos added inline comments.Aug 26 2021, 5:56 PM
openmp/libomptarget/src/device.cpp
200–202

IsNew is already false at this point, no need to reassign.

342

Currently, we don't decrement the RefCount at this point. Is this a bug in the existing code?

Thanks for reviewing.

openmp/libomptarget/src/device.cpp
200–202

I'll remove it.

342

Without this patch, the only way I know of that ForceDelete=true but IsLast=false is if the reference count is infinite. Decrementing the reference count would have no effect then (and neither did resetting), so I don't think there's an existing bug.

With this patch, a new possibility is that the hold reference count is non-zero. Because, as a result, IsLast=false, we're not to ready to unmap, so the final decrement of the dynamic reference counter after its reset needs to happen here.

grokos accepted this revision.Aug 27 2021, 9:49 AM

LGTM.

openmp/libomptarget/src/device.cpp
342

Oh, of course, makes sense.

This revision is now accepted and ready to land.Aug 27 2021, 9:49 AM

Thanks!

I'll have to work on landing next week when I can watch the bots.