]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libgomp hsa plugin: debug output for HSA runtime library loading failure
authorThomas Schwinge <thomas@codesourcery.com>
Fri, 19 May 2017 13:32:04 +0000 (15:32 +0200)
committerThomas Schwinge <tschwinge@gcc.gnu.org>
Fri, 19 May 2017 13:32:04 +0000 (15:32 +0200)
libgomp/
* plugin/plugin-hsa.c (DLSYM_FN, init_hsa_runtime_functions):
Debug output for failure.

From-SVN: r248277

libgomp/ChangeLog
libgomp/plugin/plugin-hsa.c

index 083cb8574f04c58188846695926dd814ab443b2a..84d1c839d70285ebf0792102cec6746372e12016 100644 (file)
@@ -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.
index 9cc243d66bf940c3f66368528e5b8d51bdb0612c..90ca24719d087d731f591e1653d2fcc27b8fc9bd 100644 (file)
@@ -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.  */