<div dir="ltr">[kitayama1@juronc12 ~]$ clang++ -fno-rtti -g -fopenmp -fopenmp-targets=nvptx64 test2.cpp<br>nvlink error   : Undefined reference to '__cxa_pure_virtual' in '/tmp/test2-ed87e2.cubin'<br>clang-10: error: nvlink command failed with exit code 255 (use -v to see invocation)<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jan 12, 2020 at 3:20 PM Doerfert, Johannes <<a href="mailto:jdoerfert@anl.gov">jdoerfert@anl.gov</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">Can you try it with -fno-rtti.<br>
<br>
________________________________________<br>
From: Itaru Kitayama <<a href="mailto:itaru.kitayama@gmail.com" target="_blank">itaru.kitayama@gmail.com</a>><br>
Sent: Sunday, January 12, 2020 00:17<br>
To: Doerfert, Johannes<br>
Cc: Alexey Bataev; openmp-dev<br>
Subject: Re: [Openmp-dev] Target CUDA RTL --> CUDA error is: an illegal memory access was encountered<br>
<br>
This doesn't get compile:<br>
<br>
class AbsBase {<br>
virtual int f() = 0;<br>
};<br>
class Derived : public AbsBase {<br>
private:<br>
int a;<br>
public:<br>
int f() { a = 1; return a; }<br>
};<br>
<br>
int main() {<br>
#pragma omp target parallel for<br>
for (int i=0;i<10;i++) {<br>
Derived d;<br>
}<br>
}<br>
<br>
$ clang++ -g -fopenmp -fopenmp-targets=nvptx64 test2.cpp<br>
nvlink error   : Undefined reference to '__cxa_pure_virtual' in '/tmp/test2-d564cf.cubin'<br>
nvlink error   : Undefined reference to '_ZTVN10__cxxabiv117__class_type_infoE' in '/tmp/test2-d564cf.cubin'<br>
nvlink error   : Undefined reference to '_ZTVN10__cxxabiv120__si_class_type_infoE' in '/tmp/test2-d564cf.cubin'<br>
clang-10: error: nvlink command failed with exit code 255 (use -v to see invocation)<br>
<br>
<br>
On Sun, Jan 12, 2020 at 1:45 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>
On 01/12, Itaru Kitayama wrote:<br>
> Do you guys have a timeframe for that feature<br>
> Implemented?<br>
<br>
I do not and I don't know anyone who will drive this right now.<br>
<br>
As mentioned before, you should be able to "move/copy-create" the<br>
elements on the device in order to use virtual functions.<br>
<br>
<br>
> On Sun, Jan 12, 2020 at 12:51 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>
><br>
> > On 01/11, Alexey Bataev via Openmp-dev wrote:<br>
> > > Virtual functions are not supported.<br>
> ><br>
> > Not yet ;).<br>
> ><br>
> > We'll get it with 5.1 so we might actually implement it soon. Till then,<br>
> > you have to create the object on the device you call the virtual<br>
> > function.<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>
</blockquote></div>