<div dir="ltr">Alexey,<div><br></div><div>A change like this: </div><div><br></div><div>map(to: c[0:1]), here c is a pointer</div><div><br></div><div>made the program run on the device. We're inspired about this from page 32 of the presentation:</div><div><a href="https://ukopenmpusers.co.uk/wp-content/uploads/uk-openmp-users-2018-OpenMP45Tutorial_new.pdf">https://ukopenmpusers.co.uk/wp-content/uploads/uk-openmp-users-2018-OpenMP45Tutorial_new.pdf</a><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Nov 4, 2019 at 6:36 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">I rather doubt there is a bug in the compiler. The code maps the pointer and then tries to call a member function using this pointer. It will work only with unified memory, I think. If the program does not rely on the unified memory, the program is not correct, since it doea not offload the data itself.<br>
<br>
Best regards,<br>
Alexey Bataev<br>
<br>
> 4 нояб. 2019 г., в 02:42, Doerfert, Johannes via Openmp-dev <<a href="mailto:openmp-dev@lists.llvm.org" target="_blank">openmp-dev@lists.llvm.org</a>> написал(а):<br>
> <br>
> Got it this time (attached again for the list), thanks!<br>
> <br>
> After a brief look, I think we need to open a bug for this. If the behavior is as you described, it is a problem we need to fix.<br>
> <br>
> ________________________________________<br>
> From: Itaru Kitayama <<a href="mailto:itaru.kitayama@gmail.com" target="_blank">itaru.kitayama@gmail.com</a>><br>
> Sent: Monday, November 4, 2019 01:36<br>
> To: Doerfert, Johannes<br>
> Subject: Re: [Openmp-dev] Mapped without a warning, but device code fails at run time<br>
> <br>
> I've attached the reproducer. Thanks,<br>
> <br>
> On Mon, Nov 4, 2019 at 4:27 PM Doerfert, Johannes <<a href="mailto:jdoerfert@anl.gov" target="_blank">jdoerfert@anl.gov</a><mailto:<a href="mailto:jdoerfert@anl.gov" target="_blank">jdoerfert@anl.gov</a>>> wrote:<br>
> This sounds like a bug. Changing a type should not only impact runtime<br>
> offloading behavior (with exceptions).<br>
> <br>
> I fail to locate the attachment, could you resend or put it somewhere<br>
> online?<br>
> <br>
> Thanks,<br>
>  Johannes<br>
> <br>
>> On 11/04, Itaru Kitayama wrote:<br>
>> In the attached code, if I remove the protected member, syn_id_delay_ from<br>
>> the class definition, it runs on the device.<br>
>> <br>
>> On Tue, Oct 29, 2019 at 7:40 AM Itaru Kitayama <<a href="mailto:itaru.kitayama@gmail.com" target="_blank">itaru.kitayama@gmail.com</a><mailto:<a href="mailto:itaru.kitayama@gmail.com" target="_blank">itaru.kitayama@gmail.com</a>>><br>
>> wrote:<br>
>> <br>
>>> Hi,<br>
>>> How do I enable debug messages at run time?<br>
>>> I've attached a small reproducer for you to take a look at it.<br>
>>> <br>
>>> On Tue, Oct 29, 2019 at 3:42 AM Doerfert, Johannes <<a href="mailto:jdoerfert@anl.gov" target="_blank">jdoerfert@anl.gov</a><mailto:<a href="mailto:jdoerfert@anl.gov" target="_blank">jdoerfert@anl.gov</a>>><br>
>>> wrote:<br>
>>> <br>
>>>> This can have various reasons, including a compiler bug.<br>
>>>> Try to enable debug messages by the runtime and see if that helps to<br>
>>>> determine why offloading failed.<br>
>>>> You can also provide a small reproducer so we can take a look.<br>
>>>> <br>
>>>> ________________________________________<br>
>>>> From: Openmp-dev <<a href="mailto:openmp-dev-bounces@lists.llvm.org" target="_blank">openmp-dev-bounces@lists.llvm.org</a><mailto:<a href="mailto:openmp-dev-bounces@lists.llvm.org" target="_blank">openmp-dev-bounces@lists.llvm.org</a>>> on behalf of Itaru<br>
>>>> Kitayama via Openmp-dev <<a href="mailto:openmp-dev@lists.llvm.org" target="_blank">openmp-dev@lists.llvm.org</a><mailto:<a href="mailto:openmp-dev@lists.llvm.org" target="_blank">openmp-dev@lists.llvm.org</a>>><br>
>>>> Sent: Monday, October 21, 2019 22:20<br>
>>>> To: openmp-dev<br>
>>>> Subject: [Openmp-dev] Mapped without a warning, but device code fails at<br>
>>>> run time<br>
>>>> <br>
>>>> Hi,<br>
>>>> By checking the compiler message, a type is mapped without triggering<br>
>>>> a Non-trivial type ... warning, but the device code fails at the run time<br>
>>>> leaving:<br>
>>>> <br>
>>>> Libomptarget fatal error 1: failure of target construct while offloading<br>
>>>> is mandatory<br>
>>>> <br>
>>>> (in the code accessing an element in a user-defined "vector")<br>
>>>> in this case, should I worry about a possible compiler bug?<br>
>>>> <br>
>>> <br>
> <br>
> --<br>
> <br>
> Johannes Doerfert<br>
> Researcher<br>
> <br>
> Argonne National Laboratory<br>
> Lemont, IL 60439, USA<br>
> <br>
> <a href="mailto:jdoerfert@anl.gov" target="_blank">jdoerfert@anl.gov</a><mailto:<a href="mailto:jdoerfert@anl.gov" target="_blank">jdoerfert@anl.gov</a>><br>
> <my1.cpp><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>