On 09.02.21 12:58, Thomas Schwinge wrote:
Granted. The array(:)%re access might update too much, but that's not
different to array with strides or with contiguous arrays sections
which contain component reference (and more than one component).
(Is that indeed allowed to "update too much"?)
Yes - that's the general problem with strides or bit sets;
copying only a subset – and doing so atomically – is not
always possible or feasible.
*OpenACC* 3.1 has for "2.14.4 Update Directive" the restriction:
"Noncontiguous subarrays may appear. It is implementation-specific
whether noncontiguous regions are updated by using one transfer
for each contiguous subregion, or whether the noncontiguous data
is packed, transferred once, and unpacked, or whether one or more
larger subarrays (no larger than the smallest contiguous region
that contains the specified subarray) are updated."
For map, I saw that that's the case – but I think Julian's
patch does not handle this correctly for:
type t
integer :: i, j, k
end type t
type(t) :: A(100)
... host(A(:)%j)
I think instead of transferring A(1)%j to A(100)%j, it transfers
all of A(:), i.e. also A(1)%i and A(100)%k :-(
^– Julian?
For OpenMP and map, I recall encountering a code which did do
this for OpenMP (i.e. contiguous subsection). I think it was
related to derived-type 'map', but I do not recall anymore.
Looking at the *OpenMP* 5.1 spec, I see that 'target update' also
allows: "The list items that appear in the to or from clauses
may include array sections with stride expressions."
While for the map clause, there is:
'If a list item is an array section, it must specify contiguous
storage.'
But I did not see a more explicit description how that should be
handled, contrary to the rather explicit description for OpenACC.
Tobias
-----------------
Mentor Graphics (Deutschland) GmbH, Arnulfstrasse 201, 80634 München
Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Frank
Thürauf