[Openmp-commits] [openmp] e203968 - [Libomptarget] Do not abort on failed plugin init (#77623)

via Openmp-commits openmp-commits at lists.llvm.org
Wed Jan 10 09:42:10 PST 2024


Author: Joseph Huber
Date: 2024-01-10T11:42:04-06:00
New Revision: e203968e411bba6395133d93881eb32e7895e50b

URL: https://github.com/llvm/llvm-project/commit/e203968e411bba6395133d93881eb32e7895e50b
DIFF: https://github.com/llvm/llvm-project/commit/e203968e411bba6395133d93881eb32e7895e50b.diff

LOG: [Libomptarget] Do not abort on failed plugin init (#77623)

Summary:
The current code logic is supposed to skip plugins that aren't found or
could not be loaded. However, the plugic ontained a call to `abort` if
it failed, which prevented us from continuing if initilalization the
plugin failed (such as if `dlopen` failed for the dyanmic plugins).

Added: 
    

Modified: 
    openmp/libomptarget/plugins-nextgen/common/src/PluginInterface.cpp

Removed: 
    


################################################################################
diff  --git a/openmp/libomptarget/plugins-nextgen/common/src/PluginInterface.cpp b/openmp/libomptarget/plugins-nextgen/common/src/PluginInterface.cpp
index 0db7910ec10567..1bd70b85da3414 100644
--- a/openmp/libomptarget/plugins-nextgen/common/src/PluginInterface.cpp
+++ b/openmp/libomptarget/plugins-nextgen/common/src/PluginInterface.cpp
@@ -1662,8 +1662,8 @@ extern "C" {
 int32_t __tgt_rtl_init_plugin() {
   auto Err = Plugin::initIfNeeded();
   if (Err) {
-    REPORT("Failure to initialize plugin " GETNAME(TARGET_NAME) ": %s\n",
-           toString(std::move(Err)).data());
+    [[maybe_unused]] std::string ErrStr = toString(std::move(Err));
+    DP("Failed to init plugin: %s", ErrStr.c_str());
     return OFFLOAD_FAIL;
   }
 


        


More information about the Openmp-commits mailing list