Page MenuHomePhabricator

[Libomptarget] Use new tripcount argument in the runtime.
ClosedPublic

Authored by jhuber6 on Jun 29 2022, 6:24 AM.

Details

Summary

The previous patch added an argument to the __tgt_target_kernel
runtime function which includes the tripcount used for the loop clause.
This was originally passed in via the __kmpc_push_target_tripcount
function. Now we move this logic to the kernel launch itself and remove
the need for the push function.

Depends on D128816

Diff Detail

Event Timeline

jhuber6 created this revision.Jun 29 2022, 6:24 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 29 2022, 6:24 AM
jhuber6 requested review of this revision.Jun 29 2022, 6:24 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 29 2022, 6:24 AM
jhuber6 updated this revision to Diff 443014.Jul 7 2022, 11:52 AM

Rebasing and making special tripcuont -1 for the legacy API to use. If we have this tripcount we don't set it in target and instead expect it to be set by __kmpc_push_target_tripcount

jhuber6 updated this revision to Diff 443266.Jul 8 2022, 9:16 AM

Adding a static check on the struct size.

jdoerfert added inline comments.Jul 8 2022, 9:18 AM
openmp/libomptarget/src/interface.cpp
385

Doesn't target already do this? And we should get rid of this in a follow up.

jhuber6 added inline comments.Jul 8 2022, 9:20 AM
openmp/libomptarget/src/interface.cpp
385

Oh yeah, I did it here and forgot to delete it after I decided to move it. I'll get rid of it. And why do we get rid of it in a follow-up?

jdoerfert added inline comments.Jul 8 2022, 9:27 AM
openmp/libomptarget/src/interface.cpp
385

we don't need this mutex and stuff anymore. Now the information is passed right into the target launch and not separately. See below.

openmp/libomptarget/src/omptarget.cpp
1556

And then delete everything that has to do with Device.LoopTripCnt

OK, keep it till we branched 15 but don't use it when we come from the new interface.

jhuber6 updated this revision to Diff 443268.Jul 8 2022, 9:35 AM

Updating

jdoerfert accepted this revision.Jul 8 2022, 9:37 AM

LG, one typo, see below.

openmp/libomptarget/src/omptarget.cpp
1514
This revision is now accepted and ready to land.Jul 8 2022, 9:37 AM
This revision was automatically updated to reflect the committed changes.