gcc/libgomp/testsuite
Jakub Jelinek 74c9882b80 openmp: Change omp_get_initial_device () to match OpenMP 5.1 requirements
> Therefore, I think until omp_get_initial_device () value is changed, we

The following so far untested patch implements that change.

OpenMP 4.5 said for omp_get_initial_device:
The value of the device number is implementation defined. If it is between 0 and one less than
omp_get_num_devices() then it is valid for use with all device constructs and routines; if it is
outside that range, then it is only valid for use with the device memory routines and not in the
device clause.
and OpenMP 5.0 similarly, but OpenMP 5.1 says:
The value of the device number is the value returned by the omp_get_num_devices routine.

As the new value is compatible with what has been required earlier, I think
we can change it already now.

2020-10-22  Jakub Jelinek  <jakub@redhat.com>

	* icv.c (omp_get_initial_device): Remove including corresponding
	ialias.
	* icv-device.c (omp_get_initial_device): New function.  Return
	gomp_get_num_devices ().  Add ialias.
	* target.c (resolve_device): Don't fail with
	OMP_TARGET_OFFLOAD=mandatory if device_id is equal to
	gomp_get_num_devices ().
	(omp_target_alloc, omp_target_free, omp_target_is_present,
	omp_target_memcpy, omp_target_memcpy_rect, omp_target_associate_ptr,
	omp_target_disassociate_ptr, omp_pause_resource): Use
	gomp_get_num_devices () instead of GOMP_DEVICE_HOST_FALLBACK on the
	first use in the functions, in uses dominated by the
	gomp_get_num_devices call use num_devices_openmp instead.
	* libgomp.texi (omp_get_initial_device): Document.
	* config/gcn/icv-device.c (omp_get_initial_device): New function.
	Add ialias.
	* config/nvptx/icv-device.c (omp_get_initial_device): Likewise.
	* testsuite/libgomp.c/target-40.c: New test.
2020-10-22 09:31:01 +02:00
..
config Update copyright years. 2020-01-01 12:51:42 +01:00
lib Removal of HSA offloading from gcc and libgomp 2020-08-03 18:13:00 +02:00
libgomp.c openmp: Change omp_get_initial_device () to match OpenMP 5.1 requirements 2020-10-22 09:31:01 +02:00
libgomp.c-c++-common libgomp: disable barriers in nested teams 2020-09-29 11:48:04 +01:00
libgomp.c++ OpenMP: Handle cpp_implicit_alias in declare-target discovery (PR96390) 2020-09-28 18:08:05 +02:00
libgomp.fortran openmp: Add support for the omp_get_supported_active_levels runtime library routine 2020-10-13 13:21:02 -07:00
libgomp.graphite Update copyright years. 2020-01-01 12:51:42 +01:00
libgomp.oacc-c [testsuite] Unset 'offload_target' after use 2020-07-24 14:00:43 +02:00
libgomp.oacc-c-c++-common [openacc] Fix acc declare for VLAs 2020-10-06 16:50:22 +02:00
libgomp.oacc-c++ [testsuite] Unset 'offload_target' after use 2020-07-24 14:00:43 +02:00
libgomp.oacc-fortran [openacc, libgomp, testsuite] Xfail declare-5.f90 2020-10-06 18:43:24 +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
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