data-2.f90 530 B

1234567891011121314151617181920212223242526272829303132
  1. ! { dg-do run }
  2. program test
  3. integer, parameter :: N = 8
  4. real, allocatable :: a(:,:), b(:,:)
  5. allocate (a(N,N))
  6. allocate (b(N,N))
  7. a(:,:) = 3.0
  8. b(:,:) = 0.0
  9. !$acc enter data copyin (a(1:N,1:N), b(1:N,1:N))
  10. !$acc parallel
  11. do i = 1, n
  12. do j = 1, n
  13. b(j,i) = a (j,i)
  14. end do
  15. end do
  16. !$acc end parallel
  17. !$acc exit data copyout (a(1:N,1:N), b(1:N,1:N))
  18. do i = 1, n
  19. do j = 1, n
  20. if (a(j,i) .ne. 3.0) call abort
  21. if (b(j,i) .ne. 3.0) call abort
  22. end do
  23. end do
  24. end program test