Thomas Schwinge bb75b22aba Allow matching Intel MIC in OpenMP 'declare variant'
..., and use that to improve XFAILing for Intel MIC offloading execution
instead of compilation in 'libgomp.c-c++-common/target-45.c',
'libgomp.fortran/target10.f90'.

	gcc/
	* config/i386/i386-options.c (ix86_omp_device_kind_arch_isa)
	<omp_device_arch> [ACCEL_COMPILER]: Match "intel_mic".
	* config/i386/t-omp-device (omp-device-properties-i386) <arch>:
	Add "intel_mic".
	libgomp/
	* testsuite/lib/libgomp.exp
	(check_effective_target_offload_target_intelmic): Remove 'proc'.
	(check_effective_target_offload_device_intel_mic): New 'proc'.
	* testsuite/libgomp.c-c++-common/on_device_arch.h
	(device_arch_intel_mic, on_device_arch_intel_mic): New.
	* testsuite/libgomp.c-c++-common/target-45.c: Use that for
	'dg-xfail-run-if'.
	* testsuite/libgomp.fortran/target10.f90: Likewise.
2021-08-23 17:45:40 +02:00

22 lines
608 B
Fortran

! { dg-do run }
! { dg-xfail-run-if TODO { offload_device_intel_mic } }
program main
use omp_lib
implicit none
integer :: device_num, host_device_num
logical :: initial_device
host_device_num = omp_get_device_num ()
if (host_device_num .ne. omp_get_initial_device ()) stop 1
!$omp target map(from: device_num, initial_device)
initial_device = omp_is_initial_device ()
device_num = omp_get_device_num ()
!$omp end target
if (initial_device .and. (host_device_num .ne. device_num)) stop 2
if ((.not. initial_device) .and. (host_device_num .eq. device_num)) stop 3
end program main