[llvm] [Offload] Only initialize a plugin if it is needed (PR #92765)
Joseph Huber via llvm-commits
llvm-commits at lists.llvm.org
Tue May 21 05:01:44 PDT 2024
================
@@ -160,6 +153,27 @@ void PluginManager::registerLib(__tgt_bin_desc *Desc) {
if (Entry.flags == OMP_REGISTER_REQUIRES)
PM->addRequirements(Entry.data);
+ // Initialize all the plugins that have associated images.
+ for (auto &Plugin : Plugins) {
+ if (Plugin->is_active())
----------------
jhuber6 wrote:
Whether or not the `init` method was called. I couldn't think of a good name for this, it's just a way to control whether or not we can use the plugin to do the actual checking. So, first pass just says "Is this an ELF with a matching platform" second pass says "Does this subarchitecture match".
https://github.com/llvm/llvm-project/pull/92765
More information about the llvm-commits
mailing list