[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:22:50 PST 2024


https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/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).


>From b1ac5340d561c7088f552a4caa8ba5f188afdc56 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             | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/openmp/libomptarget/plugins-nextgen/common/src/PluginInterface.cpp b/openmp/libomptarget/plugins-nextgen/common/src/PluginInterface.cpp
index 0db7910ec10567..79c1924e13171c 100644
--- a/openmp/libomptarget/plugins-nextgen/common/src/PluginInterface.cpp
+++ b/openmp/libomptarget/plugins-nextgen/common/src/PluginInterface.cpp
@@ -1662,8 +1662,7 @@ 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());
+    consumeError(std::move(Err));
     return OFFLOAD_FAIL;
   }
 



More information about the Openmp-commits mailing list