mirror of
https://github.com/gcc-mirror/gcc.git
synced 2024-11-21 13:40:47 +00:00
bf4a5efa80
Those TR13/OpenMP 6.0 routines permit a reproducible offloading to a specific device by mapping an OpenMP device number to a unique ID (UID). The GPU device UIDs should be universally unique, the one for the host is not. gcc/ChangeLog: * omp-general.cc (omp_runtime_api_procname): Add get_device_from_uid and omp_get_uid_from_device routines. include/ChangeLog: * cuda/cuda.h (cuDeviceGetUuid): Declare. (cuDeviceGetUuid_v2): Add prototype. libgomp/ChangeLog: * config/gcn/target.c (omp_get_uid_from_device, omp_get_device_from_uid): Add stub implementation. * config/nvptx/target.c (omp_get_uid_from_device, omp_get_device_from_uid): Likewise. * fortran.c (omp_get_uid_from_device_, omp_get_uid_from_device_8_): New functions. * libgomp-plugin.h (GOMP_OFFLOAD_get_uid): Add prototype. * libgomp.h (struct gomp_device_descr): Add 'uid' and 'get_uid_func'. * libgomp.map (GOMP_6.0): New, includind the new UID routines. * libgomp.texi (OpenMP Technical Report 13): Mark UID routines as 'Y'. (Device Information Routines): Document new UID routines. (Offload-Target Specifics): Document UID format. * omp.h.in (omp_get_device_from_uid, omp_get_uid_from_device): New prototype. * omp_lib.f90.in (omp_get_device_from_uid, omp_get_uid_from_device): New interface. * omp_lib.h.in: Likewise. * plugin/cuda-lib.def: Add cuDeviceGetUuid and cuDeviceGetUuid_v2 via CUDA_ONE_CALL_MAYBE_NULL. * plugin/plugin-gcn.c (GOMP_OFFLOAD_get_uid): New. * plugin/plugin-nvptx.c (GOMP_OFFLOAD_get_uid): New. * target.c (str_omp_initial_device): New static var. (STR_OMP_DEV_PREFIX): Define. (gomp_get_uid_for_device, omp_get_uid_from_device, omp_get_device_from_uid): New. (gomp_load_plugin_for_device): DLSYM_OPT the function 'get_uid'. (gomp_target_init): Set the device's 'uid' field to NULL. * testsuite/libgomp.c/device_uid.c: New test. * testsuite/libgomp.fortran/device_uid.f90: New test. |
||
---|---|---|
.. | ||
config | ||
plugin | ||
testsuite | ||
.gitattributes | ||
acc_prof.h | ||
acinclude.m4 | ||
aclocal.m4 | ||
affinity-fmt.c | ||
affinity.c | ||
alloc.c | ||
allocator.c | ||
atomic.c | ||
barrier.c | ||
basic-allocator.c | ||
ChangeLog | ||
ChangeLog.graphite | ||
config.h.in | ||
configure | ||
configure.ac | ||
configure.tgt | ||
critical.c | ||
env.c | ||
error.c | ||
fortran.c | ||
hashtab.h | ||
icv-device.c | ||
icv.c | ||
iter_ull.c | ||
iter.c | ||
libgomp_f.h.in | ||
libgomp_g.h | ||
libgomp-plugin.c | ||
libgomp-plugin.h | ||
libgomp.h | ||
libgomp.map | ||
libgomp.spec.in | ||
libgomp.texi | ||
lock.c | ||
loop_ull.c | ||
loop.c | ||
Makefile.am | ||
Makefile.in | ||
oacc-async.c | ||
oacc-cuda.c | ||
oacc-host.c | ||
oacc-init.c | ||
oacc-int.h | ||
oacc-mem.c | ||
oacc-parallel.c | ||
oacc-plugin.c | ||
oacc-plugin.h | ||
oacc-profiling.c | ||
oacc-target.c | ||
omp_lib.f90.in | ||
omp_lib.h.in | ||
omp.h.in | ||
openacc_lib.h | ||
openacc.f90 | ||
openacc.h | ||
ordered.c | ||
parallel.c | ||
priority_queue.c | ||
priority_queue.h | ||
scope.c | ||
sections.c | ||
secure_getenv.h | ||
single.c | ||
splay-tree.c | ||
splay-tree.h | ||
target-indirect.c | ||
target.c | ||
task.c | ||
taskloop.c | ||
team.c | ||
teams.c | ||
work.c |