aboutsummaryrefslogtreecommitdiff
path: root/libgomp/libgomp.map
diff options
context:
space:
mode:
authorChung-Lin Tang <cltang@codesourcery.com>2021-08-05 23:29:03 +0800
committerChung-Lin Tang <cltang@codesourcery.com>2021-08-05 23:29:03 +0800
commit0bac793ed6bad2c0c13cd1e93a1aa5808467afc8 (patch)
tree4f956146f4b129e344b00fa47e0326b831ef9928 /libgomp/libgomp.map
parent8dec72aeb54e98643c0fb3d53768cdb96cf1342a (diff)
downloadgcc-0bac793ed6bad2c0c13cd1e93a1aa5808467afc8.zip
gcc-0bac793ed6bad2c0c13cd1e93a1aa5808467afc8.tar.gz
gcc-0bac793ed6bad2c0c13cd1e93a1aa5808467afc8.tar.bz2
openmp: Implement omp_get_device_num routine
This patch implements the omp_get_device_num library routine, specified in OpenMP 5.0. GOMP_DEVICE_NUM_VAR is a macro symbol which defines name of a "device number" variable, is defined on the device-side libgomp, has it's address returned to host-side libgomp during device initialization, and the host libgomp then sets its value to the designated device number. libgomp/ChangeLog: * icv-device.c (omp_get_device_num): New API function, host side. * fortran.c (omp_get_device_num_): New interface function. * libgomp-plugin.h (GOMP_DEVICE_NUM_VAR): Define macro symbol. * libgomp.map (OMP_5.0.2): New version space with omp_get_device_num, omp_get_device_num_. * libgomp.texi (omp_get_device_num): Add documentation for new API function. * omp.h.in (omp_get_device_num): Add declaration. * omp_lib.f90.in (omp_get_device_num): Likewise. * omp_lib.h.in (omp_get_device_num): Likewise. * target.c (gomp_load_image_to_device): If additional entry for device number exists at end of returned entries from 'load_image_func' hook, copy the assigned device number over to the device variable. * config/gcn/icv-device.c (GOMP_DEVICE_NUM_VAR): Define static global. (omp_get_device_num): New API function, device side. * plugin/plugin-gcn.c ("symcat.h"): Add include. (GOMP_OFFLOAD_load_image): Add addresses of device GOMP_DEVICE_NUM_VAR at end of returned 'target_table' entries. * config/nvptx/icv-device.c (GOMP_DEVICE_NUM_VAR): Define static global. (omp_get_device_num): New API function, device side. * plugin/plugin-nvptx.c ("symcat.h"): Add include. (GOMP_OFFLOAD_load_image): Add addresses of device GOMP_DEVICE_NUM_VAR at end of returned 'target_table' entries. * testsuite/lib/libgomp.exp (check_effective_target_offload_target_intelmic): New function for testing for intelmic offloading. * testsuite/libgomp.c-c++-common/target-45.c: New test. * testsuite/libgomp.fortran/target10.f90: New test.
Diffstat (limited to 'libgomp/libgomp.map')
-rw-r--r--libgomp/libgomp.map8
1 files changed, 7 insertions, 1 deletions
diff --git a/libgomp/libgomp.map b/libgomp/libgomp.map
index 69aa695..cc44885 100644
--- a/libgomp/libgomp.map
+++ b/libgomp/libgomp.map
@@ -199,12 +199,18 @@ OMP_5.0.1 {
omp_fulfill_event_;
} OMP_5.0;
+OMP_5.0.2 {
+ global:
+ omp_get_device_num;
+ omp_get_device_num_;
+} OMP_5.0.1;
+
OMP_5.1 {
global:
omp_display_env;
omp_display_env_;
omp_display_env_8_;
-} OMP_5.0.1;
+} OMP_5.0.2;
GOMP_1.0 {
global: