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.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
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.
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.