This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Add a driver flag to enable the new device runtime library
ClosedPublic

Authored by jhuber6 on Jul 26 2021, 7:41 AM.

Details

Summary

This patch adds a driver flag -fopenmp-target-new-runtime to optionally enable the new device runtime
bitcode library. This allows users to enable the new experimental runtime
before it becomes the default in the future.

Diff Detail

Event Timeline

jhuber6 created this revision.Jul 26 2021, 7:41 AM
jhuber6 requested review of this revision.Jul 26 2021, 7:41 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 26 2021, 7:41 AM

We need a driver test.

jhuber6 updated this revision to Diff 361667.Jul 26 2021, 8:06 AM

Adding test

ye-luo added a subscriber: ye-luo.Jul 26 2021, 9:39 AM

Not clear from the summary what is the new driver option.

Can we call this something other than new? We don't tend to remove command line arguments and this won't make much sense once it's the only runtime.

I'd be inclined to add an argument called 'use_legacy_runtime' or similar, which defaults to true, instead of this one. I.e. invert the logic

clang/lib/Driver/ToolChains/AMDGPUOpenMP.cpp
229

Likewise here, how about amdgcn-legacy-. Taking advantage of the monorepo + no guarantees that mix&match clang and devicertl works.

Side note, someone should probably rename the amdgcn devicertl to amdgpu, since the gfx10 stuff is the 'rdna' arch instead of the 'gcn' one.

Not clear from the summary what is the new driver option.

It's a rewrite of the current device runtime. This option will enable it.

Can we call this something other than new? We don't tend to remove command line arguments and this won't make much sense once it's the only runtime.

I'd be inclined to add an argument called 'use_legacy_runtime' or similar, which defaults to true, instead of this one. I.e. invert the logic

I agree somewhat that it might be easier to just call this the legacy, I'm open to it. But we had other options like -enable-new-pm for awhile before it became the default so it's probably not a big deal.

clang/lib/Driver/ToolChains/AMDGPUOpenMP.cpp
229

I think changing the BC name is something we can do any time, so just calling it libomptarget-new is fine for now.

ye-luo added a comment.EditedJul 26 2021, 11:54 AM

Not clear from the summary what is the new driver option.

It's a rewrite of the current device runtime. This option will enable it.

What is the option name? I tried not to read the source code but only the summary. Considering one day, I just want to figure out the answer via the commit log.

jhuber6 edited the summary of this revision. (Show Details)Jul 26 2021, 11:55 AM

I think changing the BC name is something we can do any time, so just calling it libomptarget-new is fine for now.

Yes, let's not disrupt old workflows. The "default" runtime keeps it's name always and we swap it out at some point and remove the option (or make it a no-op for one release).

jdoerfert accepted this revision.Jul 26 2021, 12:41 PM

Can we call this something other than new? We don't tend to remove command line arguments and this won't make much sense once it's the only runtime.

We removed multiple openmp ones between 12 and 13. We'll remove this one as well as soon as we can.
Commit message spells out the option. LG

This revision is now accepted and ready to land.Jul 26 2021, 12:41 PM
This revision was landed with ongoing or failed builds.Jul 26 2021, 1:36 PM
This revision was automatically updated to reflect the committed changes.