1! { dg-do run } 2 3type t 4 integer, allocatable :: A(:,:) 5end type t 6 7type(t), allocatable :: b(:) 8 9integer :: i 10 11allocate(b(1:20)) 12do i=1,20 13 allocate(b(i)%A(1:20,1:20)) 14end do 15 16do i=1,20 17 b(i)%A(:,:) = 0 18end do 19 20!$acc enter data copyin(b) 21do i=1,20 22 !$acc enter data copyin(b(i)%A) 23end do 24 25b(1)%A(:,:) = 5 26 27!$acc update device(b(::2)) 28!$acc update device(b(1)%A(::3,::4)) 29 30do i=1,20 31 !$acc exit data copyout(b(i)%A) 32end do 33!$acc exit data copyout(b) 34 35! This is necessarily conservative because the "update" is allowed to copy 36! e.g. the whole of the containing block for a discontinuous update. 37! Try to ensure that the update covers a sufficient portion of the array. 38 39if (any(b(1)%A(::3,::4) .ne. 5)) stop 1 40do i=2,20 41 if (any(b(i)%A(:,:) .ne. 0)) stop 2 42end do 43 44end 45