2015-08-28 15:33:40 +00:00
|
|
|
! { dg-do run }
|
|
|
|
! { dg-require-effective-target offload_device }
|
|
|
|
|
|
|
|
program e_57_3
|
|
|
|
use omp_lib, only: omp_is_initial_device, omp_get_num_devices,&
|
|
|
|
omp_get_default_device, omp_set_default_device
|
|
|
|
logical :: res
|
|
|
|
integer :: default_device
|
|
|
|
|
|
|
|
default_device = omp_get_default_device ()
|
2017-10-07 00:16:47 +00:00
|
|
|
!$omp target map(from: res)
|
2015-08-28 15:33:40 +00:00
|
|
|
res = omp_is_initial_device ()
|
|
|
|
!$omp end target
|
2018-12-28 15:30:48 +00:00
|
|
|
if (res) STOP 1
|
2015-08-28 15:33:40 +00:00
|
|
|
|
|
|
|
call omp_set_default_device (omp_get_num_devices ())
|
2017-10-07 00:16:47 +00:00
|
|
|
!$omp target map(from: res)
|
2015-08-28 15:33:40 +00:00
|
|
|
res = omp_is_initial_device ()
|
|
|
|
!$omp end target
|
2018-12-28 15:30:48 +00:00
|
|
|
if (.not. res) STOP 2
|
2015-08-28 15:33:40 +00:00
|
|
|
end program
|