[Openmp-dev] Mapping of non-trivial type support

Alexey Bataev via Openmp-dev openmp-dev at lists.llvm.org
Sun Aug 4 19:28:15 PDT 2019


The plan to support it is "when it will be done". No, there is no special branch for this.

Best regards,
Alexey Bataev

4 авг. 2019 г., в 21:57, Itaru Kitayama <itaru.kitayama at gmail.com<mailto:itaru.kitayama at gmail.com>> написал(а):

Alexey et al.,
What's the plan for OpenMP 5.0 API adoption in Clang? Would you point me to a link to an appropriate web page?
Is there an OpenMP 5.0 API work-in-progress branch which I can give it a try?

On Sun, Aug 4, 2019 at 8:57 PM Alexey Bataev <a.bataev at hotmail.com<mailto:a.bataev at hotmail.com>> wrote:
clang works in accordance with the standard. Standard says that mapping is performed as bitwise copy of the objects. You can perform the bitwise copy safely only for the trivial types.
You cannot simply map a vector. You need to convert it to C/C++ array at first.
OpenMP 5.0 introduced user-defined mappers to solve the problem of non-trivial types mapping, which are not supported by clang yet. We're working on this feature.

Best regards,
Alexey Bataev

> 4 авг. 2019 г., в 1:16, Itaru Kitayama via Openmp-dev <openmp-dev at lists.llvm.org<mailto:openmp-dev at lists.llvm.org>> написал(а):
>
> Hi,
> This simple code:
>
> int main() {
>
> std::vector<int> v(100, 0);
> #pragma omp target teams distribute parallel for map(tofrom: v)
>    for (int i=0;i<100;i++) {
>         v[i] =i;
>    }
> };
>
> causes Clang to warn a message like:
>
> vectormap.cpp:31:62: warning: Non-trivial type 'std::vector<int>' is mapped, only trivial types are guaranteed to be mapped correctly [-Wopenmp-target]
> #pragma omp target teams distribute parallel for map(tofrom: v)
>
>                                    ^
> 1 warning generated.
>
> ... and encounters an issue at run time. How much non-trivial types are
> supported in trunk Clang?
> _______________________________________________
> Openmp-dev mailing list
> Openmp-dev at lists.llvm.org<mailto:Openmp-dev at lists.llvm.org>
> https://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20190805/af85a889/attachment-0001.html>


More information about the Openmp-dev mailing list