[llvm] [Libomptarget] Rework device initialization and image registration (PR #93844)

Jan Patrick Lehr via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 3 01:57:03 PDT 2024


================
@@ -117,32 +113,41 @@ struct PluginManager {
     return Devices.getExclusiveAccessor();
   }
 
-  int getNumUsedPlugins() const { return DeviceOffsets.size(); }
-
   // Initialize all plugins.
   void initAllPlugins();
 
   /// Iterator range for all plugins (in use or not, but always valid).
   auto plugins() { return llvm::make_pointee_range(Plugins); }
 
+  /// Iterator range for all plugins (in use or not, but always valid).
+  auto plugins() const { return llvm::make_pointee_range(Plugins); }
+
   /// Return the user provided requirements.
   int64_t getRequirements() const { return Requirements.getRequirements(); }
 
   /// Add \p Flags to the user provided requirements.
   void addRequirements(int64_t Flags) { Requirements.addRequirements(Flags); }
 
+  /// Returns the number of plugins that are active.
+  int getNumUsedPlugins() const {
----------------
jplehr wrote:

Should we reduce the number of different words that are used for the same thing? The comment says "active", let's have that method also call it active (or the comment say "used").
`getNumActivePlugins` 

https://github.com/llvm/llvm-project/pull/93844


More information about the llvm-commits mailing list