aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>2017-05-19 13:32:04 +0000
committertschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>2017-05-19 13:32:04 +0000
commitb7d6170b96407c80b3e21dd6a665ebff7715d62e (patch)
tree7f7042111d5fb51f8d47b1b1d8c30785108235cc
parent14b6abc7056e00418a76269739c44d9fce09220b (diff)
libgomp hsa plugin: debug output for HSA runtime library loading failure
libgomp/ * plugin/plugin-hsa.c (DLSYM_FN, init_hsa_runtime_functions): Debug output for failure. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@248277 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--libgomp/ChangeLog5
-rw-r--r--libgomp/plugin/plugin-hsa.c8
2 files changed, 11 insertions, 2 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index 083cb8574f0..84d1c839d70 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,8 @@
+2017-05-19 Thomas Schwinge <thomas@codesourcery.com>
+
+ * plugin/plugin-hsa.c (DLSYM_FN, init_hsa_runtime_functions):
+ Debug output for failure.
+
2017-05-12 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* testsuite/lib/libgomp.exp: Load scanlang.exp.
diff --git a/libgomp/plugin/plugin-hsa.c b/libgomp/plugin/plugin-hsa.c
index 9cc243d66bf..90ca24719d0 100644
--- a/libgomp/plugin/plugin-hsa.c
+++ b/libgomp/plugin/plugin-hsa.c
@@ -491,14 +491,14 @@ static struct hsa_context_info hsa_context;
#define DLSYM_FN(function) \
hsa_fns.function##_fn = dlsym (handle, #function); \
if (hsa_fns.function##_fn == NULL) \
- return false;
+ goto dl_fail;
static bool
init_hsa_runtime_functions (void)
{
void *handle = dlopen (hsa_runtime_lib, RTLD_LAZY);
if (handle == NULL)
- return false;
+ goto dl_fail;
DLSYM_FN (hsa_status_string)
DLSYM_FN (hsa_agent_get_info)
@@ -530,6 +530,10 @@ init_hsa_runtime_functions (void)
DLSYM_FN (hsa_ext_program_destroy)
DLSYM_FN (hsa_ext_program_finalize)
return true;
+
+ dl_fail:
+ HSA_DEBUG ("while loading %s: %s\n", hsa_runtime_lib, dlerror ());
+ return false;
}
/* Find kernel for an AGENT by name provided in KERNEL_NAME. */