collapse-2.f90 547 B

1234567891011121314151617181920212223242526
  1. ! { dg-do run }
  2. program collapse2
  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 164 i = 1, 3
  10. do 164 j = 4, 6
  11. do 164 k = 5, 7
  12. a(i, j, k) = i + j + k
  13. 164 end do
  14. !$acc loop collapse(2) reduction(.or.:l)
  15. firstdo: do i = 1, 3
  16. do j = 4, 6
  17. do k = 5, 7
  18. if (a(i, j, k) .ne. (i + j + k)) l = .true.
  19. end do
  20. end do
  21. end do firstdo
  22. !$acc end parallel
  23. if (l) call abort
  24. end program collapse2