diff options
author | Thomas Schwinge <tschwinge@baylibre.com> | 2024-03-07 15:51:54 +0100 |
---|---|---|
committer | Thomas Schwinge <tschwinge@baylibre.com> | 2024-03-08 16:35:28 +0100 |
commit | 84fc8f4f3263d66503663bb784b58b49dd714dd9 (patch) | |
tree | c2ad2dfb59631c472b4b0875d956dca3b76991b4 | |
parent | 37078f241a22c45db6380c5e9a79b4d08054bb3d (diff) | |
download | gcc-84fc8f4f3263d66503663bb784b58b49dd714dd9.zip gcc-84fc8f4f3263d66503663bb784b58b49dd714dd9.tar.gz gcc-84fc8f4f3263d66503663bb784b58b49dd714dd9.tar.bz2 |
GCN: The original meaning of 'GCN_SUPPRESS_HOST_FALLBACK' isn't applicable (non-shared memory system)
'GCN_SUPPRESS_HOST_FALLBACK' originated as 'HSA_SUPPRESS_HOST_FALLBACK' in the
libgomp HSA plugin, where the idea was -- in my understanding -- that you
wouldn't have device code available for all functions that may be called, and
in that case transparently (shared memory system!) do host-fallback execution.
Or, with 'HSA_SUPPRESS_HOST_FALLBACK' set, you'd get those diagnosed.
This has then been copied into the libgomp GCN plugin as
'GCN_SUPPRESS_HOST_FALLBACK'. However, the original meaning isn't applicable
for the libgomp GCN plugin anymore: we assume that we're generating device code
for all relevant functions, and we're implementing a non-shared memory system,
where we cannot transparently do host-fallback execution for individual
functions.
However, 'GCN_SUPPRESS_HOST_FALLBACK' has gained an additional meaning, to
enforce a fatal error in case that 'libhsa-runtime64.so.1' can't be dynamically
loaded; keep that meaning.
libgomp/
* plugin/plugin-gcn.c (GOMP_OFFLOAD_can_run): Don't consider
'GCN_SUPPRESS_HOST_FALLBACK' anymore (assume always-'true').
(init_hsa_context): Adjust 'GCN_SUPPRESS_HOST_FALLBACK' error
message.
-rw-r--r-- | libgomp/plugin/plugin-gcn.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/libgomp/plugin/plugin-gcn.c b/libgomp/plugin/plugin-gcn.c index 4b7ab5e..7e141a8 100644 --- a/libgomp/plugin/plugin-gcn.c +++ b/libgomp/plugin/plugin-gcn.c @@ -1524,9 +1524,11 @@ init_hsa_context (void) init_environment_variables (); if (!init_hsa_runtime_functions ()) { - GCN_WARNING ("Run-time could not be dynamically opened\n"); + const char *msg = "Run-time could not be dynamically opened"; if (suppress_host_fallback) - GOMP_PLUGIN_fatal ("GCN host fallback has been suppressed"); + GOMP_PLUGIN_fatal ("%s\n", msg); + else + GCN_WARNING ("%s\n", msg); return false; } status = hsa_fns.hsa_init_fn (); @@ -3855,15 +3857,9 @@ GOMP_OFFLOAD_can_run (void *fn_ptr) init_kernel (kernel); if (kernel->initialization_failed) - goto failure; + GOMP_PLUGIN_fatal ("kernel initialization failed"); return true; - -failure: - if (suppress_host_fallback) - GOMP_PLUGIN_fatal ("GCN host fallback has been suppressed"); - GCN_WARNING ("GCN target cannot be launched, doing a host fallback\n"); - return false; } /* Allocate memory on device N. */ |