lib-5.f90 553 B

1234567891011121314151617181920212223242526272829303132
  1. ! { dg-do run }
  2. program main
  3. use openacc
  4. implicit none
  5. integer n
  6. if (acc_get_num_devices (acc_device_nvidia) .eq. 0) call exit
  7. call acc_init (acc_device_nvidia)
  8. n = 0
  9. call acc_set_device_num (n, acc_device_nvidia)
  10. if (acc_get_device_num (acc_device_nvidia) .ne. 0) call abort
  11. if (acc_get_num_devices (acc_device_nvidia) .gt. 1) then
  12. n = 1
  13. call acc_set_device_num (n, acc_device_nvidia)
  14. if (acc_get_device_num (acc_device_nvidia) .ne. 1) call abort
  15. end if
  16. call acc_shutdown (acc_device_nvidia)
  17. end program