2016-01-14 Edward Smith-Rowland <3dw4rd@verizon.net>
[official-gcc.git] / libgomp / testsuite / libgomp.oacc-fortran / lib-7.f90
blob422df53bd3ae5eb2ec6c3cd214e0ee10a1790215
1 ! { dg-do run }
3 program main
4 implicit none
5 include "openacc_lib.h"
7 integer n
9 if (acc_get_num_devices (acc_device_nvidia) .eq. 0) call exit
11 call acc_init (acc_device_nvidia)
13 n = 0
15 call acc_set_device_num (n, acc_device_nvidia)
17 if (acc_get_device_num (acc_device_nvidia) .ne. 0) call abort
19 if (acc_get_num_devices (acc_device_nvidia) .gt. 1) then
21 n = 1
23 call acc_set_device_num (n, acc_device_nvidia)
25 if (acc_get_device_num (acc_device_nvidia) .ne. 1) call abort
27 end if
29 call acc_shutdown (acc_device_nvidia)
31 end program