This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Implement `omp_get_mapped_ptr`
ClosedPublic

Authored by tianshilei1992 on Jan 11 2023, 1:34 PM.

Details

Summary

This patch implements the function omp_get_mapped_ptr.

Fix #59945.

Diff Detail

Event Timeline

tianshilei1992 created this revision.Jan 11 2023, 1:34 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 11 2023, 1:34 PM
tianshilei1992 requested review of this revision.Jan 11 2023, 1:34 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 11 2023, 1:34 PM
jdoerfert accepted this revision.Jan 11 2023, 2:15 PM
jdoerfert added a subscriber: carlo.bertolli.

Fix the initial device case. Use a shared lock if we can already. Otherwise, it'll wait for @carlo.bertolli. LG

openmp/libomptarget/src/api.cpp
335

Otherwise it returns the device pointer, which is ptr if device_num is the value returned by omp_get_initial_device().

340

We need a shared lock here. (and basically everywhere else)

355

And this needs to be (shared) locked too.

@carlo.bertolli will fix these up consistently (see also above).

This revision is now accepted and ready to land.Jan 11 2023, 2:15 PM
tianshilei1992 marked 3 inline comments as done.

rebase and fix comments

Herald added a project: Restricted Project. · View Herald TranscriptJan 11 2023, 2:39 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
tianshilei1992 added inline comments.Jan 11 2023, 2:45 PM
openmp/libomptarget/src/api.cpp
355

Yeah, they will be needed fixed consistently.

This revision was landed with ongoing or failed builds.Jan 11 2023, 7:05 PM
This revision was automatically updated to reflect the committed changes.