aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorTobias Burnus <tburnus@baylibre.com>2024-09-23 15:58:39 +0200
committerTobias Burnus <tburnus@baylibre.com>2024-09-23 15:58:39 +0200
commitcdb9aa0f623ec7899da445a47f4a502b2987dc7b (patch)
treea228cf5ab250fea524958ea258dcfd038531ecdb /gcc
parentffd861c808f307c865659b556dd5a8c922bd6a51 (diff)
downloadgcc-cdb9aa0f623ec7899da445a47f4a502b2987dc7b.zip
gcc-cdb9aa0f623ec7899da445a47f4a502b2987dc7b.tar.gz
gcc-cdb9aa0f623ec7899da445a47f4a502b2987dc7b.tar.bz2
OpenMP: Fix omp_get_device_from_uid, minor cleanup
In Fortran, omp_get_device_from_uid can also accept substrings, which are then not NUL terminated. Fixed by introducing a fortran.c wrapper function. Additionally, in case of a fail the plugin functions now return NULL instead of failing fatally such that a fall-back UID is generated. gcc/ChangeLog: * omp-general.cc (omp_runtime_api_procname): Strip "omp_" from string; move get_device_from_uid as now a '_' suffix exists. libgomp/ChangeLog: * fortran.c (omp_get_device_from_uid_): New function. * libgomp.map (GOMP_6.0): Add it. * oacc-host.c (host_dispatch): Init '.uid' and '.get_uid_func'. * omp_lib.f90.in: Make it used by removing bind(C). * omp_lib.h.in: Likewise. * target.c (omp_get_device_from_uid): Ensure the device is initialized. * plugin/plugin-gcn.c (GOMP_OFFLOAD_get_uid): Add function comment; return NULL in case of an error. * plugin/plugin-nvptx.c (GOMP_OFFLOAD_get_uid): Likewise. * testsuite/libgomp.fortran/device_uid.f90: Update to test substrings.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/omp-general.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/omp-general.cc b/gcc/omp-general.cc
index 12788ad..3dfbc31 100644
--- a/gcc/omp-general.cc
+++ b/gcc/omp-general.cc
@@ -3260,7 +3260,6 @@ omp_runtime_api_procname (const char *name)
"alloc",
"calloc",
"free",
- "get_device_from_uid",
"get_interop_int",
"get_interop_ptr",
"get_mapped_ptr",
@@ -3290,6 +3289,7 @@ omp_runtime_api_procname (const char *name)
"get_cancellation",
"get_default_allocator",
"get_default_device",
+ "get_device_from_uid",
"get_device_num",
"get_dynamic",
"get_initial_device",
@@ -3339,7 +3339,7 @@ omp_runtime_api_procname (const char *name)
as DECL_NAME only omp_* and omp_*_8 appear. */
"display_env",
"get_ancestor_thread_num",
- "omp_get_uid_from_device",
+ "get_uid_from_device",
"get_partition_place_nums",
"get_place_num_procs",
"get_place_proc_ids",