aboutsummaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.oacc-fortran/lib-7.f90
blob: 422df53bd3ae5eb2ec6c3cd214e0ee10a1790215 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
! { dg-do run }

program main
  implicit none
  include "openacc_lib.h"

  integer n

  if (acc_get_num_devices (acc_device_nvidia) .eq. 0) call exit

  call acc_init (acc_device_nvidia)

  n = 0

  call acc_set_device_num (n, acc_device_nvidia)

  if (acc_get_device_num (acc_device_nvidia) .ne. 0) call abort

  if (acc_get_num_devices (acc_device_nvidia) .gt. 1) then

    n = 1

    call acc_set_device_num (n, acc_device_nvidia)

    if (acc_get_device_num (acc_device_nvidia) .ne. 1) call abort

  end if

  call acc_shutdown (acc_device_nvidia)

end program