acc_on_device-1-1.f90 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. ! { dg-additional-options "-cpp" }
  2. ! TODO: Have to disable the acc_on_device builtin for we want to test the
  3. ! libgomp library function? The command line option
  4. ! '-fno-builtin-acc_on_device' is valid for C/C++/ObjC/ObjC++ but not for
  5. ! Fortran.
  6. use openacc
  7. implicit none
  8. ! Host.
  9. if (.not. acc_on_device (acc_device_none)) call abort
  10. if (.not. acc_on_device (acc_device_host)) call abort
  11. if (acc_on_device (acc_device_host_nonshm)) call abort
  12. if (acc_on_device (acc_device_not_host)) call abort
  13. if (acc_on_device (acc_device_nvidia)) call abort
  14. ! Host via offloading fallback mode.
  15. !$acc parallel if(.false.)
  16. if (.not. acc_on_device (acc_device_none)) call abort
  17. if (.not. acc_on_device (acc_device_host)) call abort
  18. if (acc_on_device (acc_device_host_nonshm)) call abort
  19. if (acc_on_device (acc_device_not_host)) call abort
  20. if (acc_on_device (acc_device_nvidia)) call abort
  21. !$acc end parallel
  22. #if !ACC_DEVICE_TYPE_host
  23. ! Offloaded.
  24. !$acc parallel
  25. if (acc_on_device (acc_device_none)) call abort
  26. if (acc_on_device (acc_device_host)) call abort
  27. #if ACC_DEVICE_TYPE_host_nonshm
  28. if (.not. acc_on_device (acc_device_host_nonshm)) call abort
  29. #else
  30. if (acc_on_device (acc_device_host_nonshm)) call abort
  31. #endif
  32. if (.not. acc_on_device (acc_device_not_host)) call abort
  33. #if ACC_DEVICE_TYPE_nvidia
  34. if (.not. acc_on_device (acc_device_nvidia)) call abort
  35. #else
  36. if (acc_on_device (acc_device_nvidia)) call abort
  37. #endif
  38. !$acc end parallel
  39. #endif
  40. end