1! { dg-do run }
2
3program main
4  implicit none
5  include "openacc_lib.h"
6
7  integer n
8
9  if (acc_get_num_devices (acc_device_nvidia) .eq. 0) call exit
10
11  call acc_init (acc_device_nvidia)
12
13  n = 0
14
15  call acc_set_device_num (n, acc_device_nvidia)
16
17  if (acc_get_device_num (acc_device_nvidia) .ne. 0) STOP 1
18
19  if (acc_get_num_devices (acc_device_nvidia) .gt. 1) then
20
21    n = 1
22
23    call acc_set_device_num (n, acc_device_nvidia)
24
25    if (acc_get_device_num (acc_device_nvidia) .ne. 1) STOP 2
26
27  end if
28
29  call acc_shutdown (acc_device_nvidia)
30
31end program
32