<div dir="ltr">Alexey et al.,<div>What's the plan for OpenMP 5.0 API adoption in Clang? Would you point me to a link to an appropriate web page? </div><div>Is there an OpenMP 5.0 API work-in-progress branch which I can give it a try? </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Aug 4, 2019 at 8:57 PM Alexey Bataev <<a href="mailto:a.bataev@hotmail.com">a.bataev@hotmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">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.<br>
You cannot simply map a vector. You need to convert it to C/C++ array at first.<br>
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.<br>
<br>
Best regards,<br>
Alexey Bataev<br>
<br>
> 4 авг. 2019 г., в 1:16, Itaru Kitayama via Openmp-dev <<a href="mailto:openmp-dev@lists.llvm.org" target="_blank">openmp-dev@lists.llvm.org</a>> написал(а):<br>
> <br>
> Hi,<br>
> This simple code:<br>
> <br>
> int main() {<br>
>  <br>
> std::vector<int> v(100, 0);<br>
> #pragma omp target teams distribute parallel for map(tofrom: v)<br>
>    for (int i=0;i<100;i++) {<br>
>         v[i] =i;<br>
>    }<br>
> };<br>
> <br>
> causes Clang to warn a message like:<br>
> <br>
> vectormap.cpp:31:62: warning: Non-trivial type 'std::vector<int>' is mapped, only trivial types are guaranteed to be mapped correctly [-Wopenmp-target]<br>
> #pragma omp target teams distribute parallel for map(tofrom: v)<br>
>                           <br>
>                                    ^<br>
> 1 warning generated.<br>
> <br>
> ... and encounters an issue at run time. How much non-trivial types are<br>
> supported in trunk Clang?<br>
> _______________________________________________<br>
> Openmp-dev mailing list<br>
> <a href="mailto:Openmp-dev@lists.llvm.org" target="_blank">Openmp-dev@lists.llvm.org</a><br>
> <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev</a><br>
</blockquote></div>