gcc/libgomp/testsuite
Chung-Lin Tang 0bac793ed6 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.
2021-08-05 23:29:03 +08:00
..
config Update copyright years. 2021-01-04 10:26:59 +01:00
lib openmp: Implement omp_get_device_num routine 2021-08-05 23:29:03 +08:00
libgomp.c Add 'default' to -foffload=; document that flag [PR67300] 2021-06-29 16:00:04 +02:00
libgomp.c++ openmp: in_reduction clause support on target construct 2021-06-24 11:35:08 +02:00
libgomp.c-c++-common openmp: Implement omp_get_device_num routine 2021-08-05 23:29:03 +08:00
libgomp.fortran openmp: Implement omp_get_device_num routine 2021-08-05 23:29:03 +08:00
libgomp.graphite Backwards jump threader rewrite with ranger. 2021-07-29 08:24:50 +02:00
libgomp.oacc-c [testsuite] Unset 'offload_target' after use 2020-07-24 14:00:43 +02:00
libgomp.oacc-c++ Don't require 'openacc_nvidia_accel_selected' in additional 'libgomp.oacc-*/declare-*' 2021-06-08 11:21:47 +02:00
libgomp.oacc-c-c++-common [OpenACC] Extract 'pass_oacc_loop_designation' out of 'pass_oacc_device_lower' 2021-07-29 09:19:44 +02:00
libgomp.oacc-fortran [OpenACC] Extract 'pass_oacc_loop_designation' out of 'pass_oacc_device_lower' 2021-07-29 09:19:44 +02:00
Makefile.am libgomp/test: Remove a build sysroot fix regression 2020-04-06 23:32:45 +01:00
Makefile.in libgomp: Regenerate configure files with automake 1.15.1 2020-10-02 12:08:47 +02:00
libgomp-site-extra.exp.in libgomp/test: Remove a build sysroot fix regression 2020-04-06 23:32:45 +01:00
libgomp-test-support.exp.in libgomp/test: Remove a build sysroot fix regression 2020-04-06 23:32:45 +01:00