This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Replace global InfoLevel with a reference to an internal one.
ClosedPublic

Authored by jhuber6 on Apr 22 2021, 12:56 PM.

Details

Summary

This patch improves the implementation of D100774 by replacing the global
variable introduced with a function that returns a reference to an internal
one. This removes the need to define the variable in every plugin that uses it.

Diff Detail

Event Timeline

jhuber6 created this revision.Apr 22 2021, 12:56 PM
jhuber6 requested review of this revision.Apr 22 2021, 12:56 PM
JonChesterfield accepted this revision.Apr 22 2021, 2:05 PM

LGTM, thanks.

Is there anything special about the cuda plugin here? I see it's the only one with an implementation of __tgt_rtl_set_info_flag, but wasn't following along closely enough to see what that's used for.

This revision is now accepted and ready to land.Apr 22 2021, 2:05 PM

LGTM, thanks.

Is there anything special about the cuda plugin here? I see it's the only one with an implementation of __tgt_rtl_set_info_flag, but wasn't following along closely enough to see what that's used for.

The purpose of the function is so the host can set the info level in the plugin, since they're separate libraries. I only implemented it for cuda because it's the only one that uses InfoLevel right now and it's optional.

I only implemented it for cuda because it's the only one that uses InfoLevel right now and it's optional.

Yep, I see that. I haven't looked up what it's used for and was wondering if amdgpu wants the same feature. Will leave that for another day though.

Yep, I see that. I haven't looked up what it's used for and was wondering if amdgpu wants the same feature. Will leave that for another day though.

I'd recommend using it if you want to print anything to the user without requiring debug. The current uses are shown in the docs, https://openmp.llvm.org/docs/design/Runtimes.html#libomptarget-info.

This revision was landed with ongoing or failed builds.Apr 23 2021, 6:44 AM
This revision was automatically updated to reflect the committed changes.