[Openmp-commits] [PATCH] D60972: [OpenMP 5.0] libomptarget interface for declare mapper functions

Lingda Li via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Wed Jun 5 09:31:17 PDT 2019


lildmh added a comment.

In D60972#1530490 <https://reviews.llvm.org/D60972#1530490>, @Hahnfeld wrote:

> In D60972#1529265 <https://reviews.llvm.org/D60972#1529265>, @lildmh wrote:
>
> > In D60972#1529238 <https://reviews.llvm.org/D60972#1529238>, @Hahnfeld wrote:
> >
> > > In D60972#1529215 <https://reviews.llvm.org/D60972#1529215>, @lildmh wrote:
> > >
> > > > The compiler doesn't generate code related to `std::vector`. It's only used in the runtime implementation, so it should be okay with Fortran. Again, the IBM and Intel compiler people seem to agree with it.
> > >
> > >
> > > Maybe I don't understand where `rt_mapper_handle` comes from. According to the design slides and D59474 <https://reviews.llvm.org/D59474>, it passed as an argument to the generated `omp_mapper[...]` function, but how is the runtime system involved in its creation? Will there be additional interface functions / changes that will call this?
> >
> >
> > The idea is the runtime will create a `MapperComponentsTy` (`std::vector`) before calling the mapper function, in, for instance, `__tgt_target_data_begin` (These parts will be implemented in later patches). When the mapper function is called, the pointer of `MapperComponentsTy` is passed to it, as `void *rt_mapper_handle`. The mapper function will call `__kmpc_push_mapper_component` using this `rt_mapper_handle`, and then the runtime can put it into the `MapperComponentsTy`
>
>
> That's hard to guess from the current patch and isn't in the design slides either (or I have overlooked it). Such information should be made available to reviewers such that they can assess the implementation!


Sorry for the inconvenience. I was assuming the reviewer is in the biweekly OpenMP Clang meeting where this scheme is discussed extensively. If you are interested, I can ask Ravi to add you to the mailing list.

> If the new functions `mapper_num_components` and `push_mapper_component` are only used by a "callback" that is called from the runtime, why do we need to export them? We could pass the function pointers next to `rt_mapper_handle` and be done with it.

That sounds reasonable to have them function pointers, although I am not sure why it is better than exporting these functions. I present this idea to others in that meeting today, and let's see how they like it.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60972/new/

https://reviews.llvm.org/D60972





More information about the Openmp-commits mailing list