[PATCH] D84192: [OpenMP5.0] map item can be non-contiguous for target update
Alexey Bataev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 21 15:55:16 PDT 2020
ABataev added a comment.
In D84192#2165517 <https://reviews.llvm.org/D84192#2165517>, @cchen wrote:
> In D84192#2165438 <https://reviews.llvm.org/D84192#2165438>, @ABataev wrote:
>
> > In D84192#2165396 <https://reviews.llvm.org/D84192#2165396>, @cchen wrote:
> >
> > > In D84192#2165249 <https://reviews.llvm.org/D84192#2165249>, @ABataev wrote:
> > >
> > > > In D84192#2165235 <https://reviews.llvm.org/D84192#2165235>, @cchen wrote:
> > > >
> > > > > In D84192#2164885 <https://reviews.llvm.org/D84192#2164885>, @ABataev wrote:
> > > > >
> > > > > > Also, what about compatibility with declare mapper? Can you add tests for it?
> > > > >
> > > > >
> > > > > There's a restriction for map clause that non-contiguous is not allowed and I guess it also applies to declare mapper.
> > > >
> > > >
> > > > I see that to/from clauses allow to use mappers too:
> > > >
> > > > to([mapper(mapper-identifier):]locator-list) from([mapper(mapper-identifier):]locator-list
> > > >
> > >
> > >
> > > I'm confused of how to use to([mapper(mapper-identifier):]locator-list) with array section.
> > > For this case:
> > >
> > > class C {
> > > public:
> > > int a;
> > > double b[3][4][5];
> > > };
> > >
> > > #pragma omp declare mapper(id: C s) map(s.a, s.b[0:3][0:4][0:5])
> > >
> > > #pragma omp target update from(mapper(id): c)
> > >
> > >
> > > Clang already has a semantic check in from clause when mapper is used: "mapper type must be of struct, union or class type".
> > > So the only item I can put in from clause in the above example is `c` and I cannot put c.b[0:2][1:2][0:2] or any even c.b[0:2].
> >
> >
> > Does clang compile your example? If not, shall it be allowed for to/from clauses or not?
>
>
> Clang can compile my example but the problem is that Clang do not accept something like `#pragma omp target update from(mapper(id): c.b[0:2][1:2][2:2])` (non-contiguous) or even `#pragma omp target update from(mapper(id): c.b[2][1][0:2])` (contiguous).
> Actually, Clang now only accepts `c` as struct/union/class type in `from(mapper(id): c)`. And the reason for the restriction is from declare mapper directive - "The type must be of struct, union or class type in C and C++".
And it is fine. How does it work in declare mapper, the main question? Does it support extended array sections format mapoers with maps, to and from? Shall it be supported in declare mapper at all?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D84192/new/
https://reviews.llvm.org/D84192
More information about the cfe-commits
mailing list