Nested data directives order

Hello,
If I have nested data directives as shown below,

!$acc data create(A)
    ...
!$acc data create(B)
    ...
!$acc end data    !! location_1
    ...
!$acc data create(C)
    ...
!$acc end data
!$acc end data

can I safely assume that the inner !$acc end data statement shown as location_1 will release B only and not any other existing arrays?

I need to free memory as soon as an array is not needed so that I don’t run out of memory.
Thanks.

Correct. Data region “A” will span across both “B” and “C” while “B” and “C”'s lifetime will only be within their respective inner data regions.

  • Mat