routine-4.f90 396 B

123456789101112131415161718192021222324
  1. ! { dg-do run }
  2. ! { dg-options "-fno-inline" }
  3. integer, parameter :: n = 10
  4. integer :: a(n), i
  5. do i = 1, n
  6. a(i) = i
  7. end do
  8. !$acc parallel
  9. !$acc loop
  10. do i = 1, n
  11. call incr(a(i))
  12. end do
  13. !$acc end parallel
  14. do i = 1, n
  15. if (a(i) .ne. (i + 1)) call abort
  16. end do
  17. end
  18. subroutine incr (x)
  19. !$acc routine
  20. integer, intent(inout) :: x
  21. x = x + 1
  22. end subroutine incr