On 2020/9/29 6:16 PM, Jakub Jelinek wrote:
On Tue, Sep 01, 2020 at 09:16:23PM +0800, Chung-Lin Tang wrote:
this patch set implements parts of the target mapping changes introduced
in OpenMP 5.0, mainly the attachment requirements for pointer-based
list items, and the clause ordering.
The first patch here are the C/C++ front-end changes.
Do you think you could mention in detail which exact target mapping changes
in the spec is the patchset attempting to implement?
5.0 unfortunately contains many target mapping changes and this patchset
can't implement them all and it would be easier to see the list of rules
(e.g. from openmp-diff-full-4.5-5.0.pdf, if you don't have that one, I can
send it to you), rather than trying to guess them from the patchset.
Thanks.
Hi Jakub,
the main implemented features are the clause ordering rules:
"For a given construct, the effect of a map clause with the to, from, or
tofrom map-type is
ordered before the effect of a map clause with the alloc, release, or delete
map-type."
"If item1 is a list item in a map clause, and item2 is another list item in a
map clause on
the same construct that has a base pointer that is, or is part of, item1,
then:
* If the map clause(s) appear on a target, target data, or target enter
data construct,
then on entry to the corresponding region the effect of the map clause on
item1 is ordered
to occur before the effect of the map clause on item2.
* If the map clause(s) appear on a target, target data, or target exit
data construct then
on exit from the corresponding region the effect of the map clause on
item2 is ordered to
occur before the effect of the map clause on item1."
and the base-pointer attachment behavior:
"If a list item in a map clause has a base pointer, and a pointer variable is
present in the device data
environment that corresponds to the base pointer when the effect of the map
clause occurs, then if
the corresponding pointer or the corresponding list item is created in the
device data environment
on entry to the construct, then:
...
2. The corresponding pointer variable becomes an attached pointer for the
corresponding list item."
(these passages are all in the "2.19.7.1 map Clause" section of the 5.0 spec,
all are new as
also verified from the diff PDFs you sent us)
Also, because of the these new features, having multiple maps of the same
variables now have meaning
in OpenMP, so changes in the C/C++ frontends to relax the no-duplicate rules
are also included.
gcc/c-family/
* c-common.h (c_omp_adjust_clauses): New declaration.
* c-omp.c (c_omp_adjust_clauses): New function.
This function name is too broad, it should have target in it as it is
for processing target* construct clauses only.
Jakub
Sure, I'll update this naming in a later version.
Thanks,
Chung-Lin