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

Joseph Huber via Openmp-commits openmp-commits at lists.llvm.org
Wed Jan 10 09:31:39 PST 2024


https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/77623

>From e302ab2dc5b1cfdc8985a0621266e771a26fd15b Mon Sep 17 00:00:00 2001
From: Joseph Huber <huberjn at outlook.com>
Date: Wed, 10 Jan 2024 11:20:45 -0600
Subject: [PATCH] [Libomptarget] Do not abort on failed plugin init

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).
---
 .../plugins-nextgen/common/src/PluginInterface.cpp            | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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