]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
GCN, nvptx: Fatal error for missing symbols in 'libhsa-runtime64.so.1', 'libcuda...
authorThomas Schwinge <tschwinge@baylibre.com>
Thu, 7 Mar 2024 11:31:52 +0000 (12:31 +0100)
committerThomas Schwinge <tschwinge@baylibre.com>
Fri, 8 Mar 2024 15:35:28 +0000 (16:35 +0100)
If 'libhsa-runtime64.so.1', 'libcuda.so.1' are not available, the corresponding
libgomp plugin/device gets disabled, as before.  But if they are available,
report any inconsistencies such as missing symbols, similar to how we fail in
presence of other issues during device initialization.

libgomp/
* plugin/plugin-gcn.c (init_hsa_runtime_functions): Fatal error
for missing symbols.
* plugin/plugin-nvptx.c (init_cuda_lib): Likewise.

libgomp/plugin/plugin-gcn.c
libgomp/plugin/plugin-nvptx.c

index 2771123252a87389febf5b421d21f84f89cd8267..4b7ab5e83c57c7b37f72379604c667d6f1fb8117 100644 (file)
@@ -1382,9 +1382,10 @@ init_hsa_runtime_functions (void)
 #define DLSYM_FN(function) \
   hsa_fns.function##_fn = dlsym (handle, #function); \
   if (hsa_fns.function##_fn == NULL) \
-    return false;
+    GOMP_PLUGIN_fatal ("'%s' is missing '%s'", hsa_runtime_lib, #function);
 #define DLSYM_OPT_FN(function) \
   hsa_fns.function##_fn = dlsym (handle, #function);
+
   void *handle = dlopen (hsa_runtime_lib, RTLD_LAZY);
   if (handle == NULL)
     return false;
index c04c3acd67926529f154cbbeec560035b6eca86d..2bc7b850671acb096c7d85ac73f8140f57482c5b 100644 (file)
@@ -126,7 +126,7 @@ init_cuda_lib (void)
 # define CUDA_ONE_CALL_1(call, allow_null)             \
   cuda_lib.call = dlsym (h, #call);    \
   if (!allow_null && cuda_lib.call == NULL)            \
-    return false;
+    GOMP_PLUGIN_fatal ("'%s' is missing '%s'", cuda_runtime_lib, #call);
 #include "cuda-lib.def"
 # undef CUDA_ONE_CALL
 # undef CUDA_ONE_CALL_1