gcc/libgomp/config/nvptx
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
..
affinity-fmt.c Update copyright years. 2021-01-04 10:26:59 +01:00
atomic.c [libgomp, nvptx] Add __sync_compare_and_swap_16 2020-09-14 08:28:56 +02:00
bar.c Update copyright years. 2021-01-04 10:26:59 +01:00
bar.h Update copyright years. 2021-01-04 10:26:59 +01:00
doacross.h Update copyright years. 2021-01-04 10:26:59 +01:00
error.c Update copyright years. 2021-01-04 10:26:59 +01:00
icv-device.c openmp: Implement omp_get_device_num routine 2021-08-05 23:29:03 +08:00
oacc-parallel.c [libgomp] Truncate config/nvptx/oacc-parallel.c 2018-08-01 13:01:45 -07:00
simple-bar.h Update copyright years. 2021-01-04 10:26:59 +01:00
target.c openmp: Fix up handling of target constructs in offloaded routines [PR100573] 2021-05-26 11:28:42 +02:00
task.c Update copyright years. 2021-01-04 10:26:59 +01:00
team.c Update copyright years. 2021-01-04 10:26:59 +01:00
teams.c Update copyright years. 2021-01-04 10:26:59 +01:00
time.c Update copyright years. 2021-01-04 10:26:59 +01:00