collapse-1.f90 545 B

12345678910111213141516171819202122232425262728
  1. ! { dg-do run }
  2. program collapse1
  3. integer :: i, j, k, a(1:3, 4:6, 5:7)
  4. logical :: l
  5. l = .false.
  6. a(:, :, :) = 0
  7. !$acc parallel
  8. !$acc loop collapse(4 - 1)
  9. do i = 1, 3
  10. do j = 4, 6
  11. do k = 5, 7
  12. a(i, j, k) = i + j + k
  13. end do
  14. end do
  15. end do
  16. !$acc loop collapse(2) reduction(.or.:l)
  17. do i = 1, 3
  18. do j = 4, 6
  19. do k = 5, 7
  20. if (a(i, j, k) .ne. (i + j + k)) l = .true.
  21. end do
  22. end do
  23. end do
  24. !$acc end parallel
  25. if (l) call abort
  26. end program collapse1