Commit 0da2f96a by Thomas Schwinge Committed by Thomas Schwinge

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.

From-SVN: r248277
parent 01c712cb
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> 2017-05-12 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* testsuite/lib/libgomp.exp: Load scanlang.exp. * testsuite/lib/libgomp.exp: Load scanlang.exp.
......
...@@ -491,14 +491,14 @@ static struct hsa_context_info hsa_context; ...@@ -491,14 +491,14 @@ static struct hsa_context_info hsa_context;
#define DLSYM_FN(function) \ #define DLSYM_FN(function) \
hsa_fns.function##_fn = dlsym (handle, #function); \ hsa_fns.function##_fn = dlsym (handle, #function); \
if (hsa_fns.function##_fn == NULL) \ if (hsa_fns.function##_fn == NULL) \
return false; goto dl_fail;
static bool static bool
init_hsa_runtime_functions (void) init_hsa_runtime_functions (void)
{ {
void *handle = dlopen (hsa_runtime_lib, RTLD_LAZY); void *handle = dlopen (hsa_runtime_lib, RTLD_LAZY);
if (handle == NULL) if (handle == NULL)
return false; goto dl_fail;
DLSYM_FN (hsa_status_string) DLSYM_FN (hsa_status_string)
DLSYM_FN (hsa_agent_get_info) DLSYM_FN (hsa_agent_get_info)
...@@ -530,6 +530,10 @@ init_hsa_runtime_functions (void) ...@@ -530,6 +530,10 @@ init_hsa_runtime_functions (void)
DLSYM_FN (hsa_ext_program_destroy) DLSYM_FN (hsa_ext_program_destroy)
DLSYM_FN (hsa_ext_program_finalize) DLSYM_FN (hsa_ext_program_finalize)
return true; 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. */ /* Find kernel for an AGENT by name provided in KERNEL_NAME. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment