<div dir="ltr">Are we supposed to supply this flag from now on? </div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jan 16, 2020 at 9:55 AM Alexey Bataev <<a href="mailto:a.bataev@outlook.com">a.bataev@outlook.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">
<div>
<p>Compile without RTTI, -fno-rtti<br>
</p>
<pre cols="72">-------------
Best regards,
Alexey Bataev</pre>
<div>15.01.2020 2:52 PM, Itaru Kitayama
пишет:<br>
</div>
<blockquote type="cite">
<div dir="ltr">Today's Trunk can not build below code:
<div><br>
</div>
<div> #include <stdio.h></div>
<div><br>
</div>
<div>class AbsBase {</div>
<div>public:</div>
<div><span style="white-space:pre-wrap"> </span>virtual int
f(int&) = 0;</div>
<div>};</div>
<div><br>
</div>
<div>class Derived : public AbsBase {</div>
<div>private:</div>
<div><span style="white-space:pre-wrap"> </span>int d_;</div>
<div>public:</div>
<div><span style="white-space:pre-wrap"> </span>int f(int &x) {
return d_ = x; }</div>
<div><br>
</div>
<div>};</div>
<div><br>
</div>
<div>int main() {</div>
<div>#pragma omp target parallel for</div>
<div><span style="white-space:pre-wrap"> </span>for (int
i=0;i<10;i++) {</div>
<div><span style="white-space:pre-wrap"> </span>int x=123;</div>
<div><span style="white-space:pre-wrap"> </span>Derived d;</div>
<div><span style="white-space:pre-wrap"> </span>printf("%d\n",d.f(x));</div>
<div><span style="white-space:pre-wrap"> </span>}</div>
<div>}</div>
<div><br>
</div>
<div>[kitayama1@juronc12 pcp0151]$ clang++ -g -fopenmp
-fopenmp-targets=nvptx64 test2.cpp<br>
nvlink error : Undefined reference to
'_ZTVN10__cxxabiv117__class_type_infoE' in
'/tmp/test2-515e4a.cubin'<br>
nvlink error : Undefined reference to
'_ZTVN10__cxxabiv120__si_class_type_infoE' in
'/tmp/test2-515e4a.cubin'<br>
clang-11: error: nvlink command failed with exit code 255 (use
-v to see invocation)<br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Wed, Jan 15, 2020 at 11:31
PM Alexey Bataev <<a href="mailto:a.bataev@hotmail.com" target="_blank">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">
<div dir="auto">
Yes, it works, since you're actually don't use mapped data.
Instead you create the local one, which can be used directly
without any issues. Local objects should work fine,but not
the mapped ones.<br>
<br>
<div dir="ltr">Best regards,
<div>Alexey Bataev</div>
</div>
<div dir="ltr"><br>
<blockquote type="cite">14 янв. 2020 г., в 23:17, Itaru
Kitayama <<a href="mailto:itaru.kitayama@gmail.com" target="_blank">itaru.kitayama@gmail.com</a>>
написал(а):<br>
<br>
</blockquote>
</div>
<blockquote type="cite">
<div dir="ltr">
<div dir="ltr">#include <stdio.h><br>
<br>
class Base {<br>
public:<br>
virtual int f() { return 2;}<br>
};<br>
class D : public Base {<br>
public:<br>
int f() { return 1234; }<br>
};<br>
<br>
int main() {<br>
D *d = new D();<br>
#pragma omp target parallel for map(to: d[0:1])<br>
for (int i=0;i<10;i++) {<br>
D d1(*d);<br>
printf("arr[0] is %d\n", d1.f());<br>
}<br>
}<br>
<div><br>
</div>
<div>The above works even though an instance of class
D is not a trivially mappable type.</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Wed, Jan 15, 2020
at 2:32 PM Alexey Bataev <<a href="mailto:a.bataev@hotmail.com" target="_blank">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">
<div dir="auto">And it should fail since you're
mapping non trivially copyable type.<br>
<br>
<div dir="ltr">Best regards,
<div>Alexey Bataev</div>
</div>
<div dir="ltr"><br>
<blockquote type="cite">14 янв. 2020 г., в
19:14, Itaru Kitayama <<a href="mailto:itaru.kitayama@gmail.com" target="_blank">itaru.kitayama@gmail.com</a>>
написал(а):<br>
<br>
</blockquote>
</div>
<blockquote type="cite">
<div dir="ltr">
<div dir="ltr">
<div>This piece of C++ program execution
fails at run time.</div>
<div><br>
</div>
#include <stdio.h><br>
<br>
class AbsBase {<br>
public:<br>
virtual int f() = 0;<br>
};<br>
<br>
class Derived : public AbsBase {<br>
private:<br>
int *arr = new int[100];<br>
public:<br>
int f() { return arr[0]; }<br>
void fillarray() {<br>
arr[0] = 1234;<br>
}<br>
};<br>
<br>
int main() {<br>
AbsBase *absBase = new Derived();<br>
static_cast<Derived*>(absBase)->fillarray();<br>
#pragma omp target parallel for map(to:
absBase[0:1])<br>
for (int i=0;i<10;i++) {<br>
Derived
d1(*static_cast<Derived*>(absBase));<br>
printf("arr[0] is %d\n",
d1.f());<br>
}<br>
}<br>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Sun,
Jan 12, 2020 at 1:45 PM Doerfert, Johannes
<<a href="mailto:jdoerfert@anl.gov" target="_blank">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">
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>>
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><br>
</blockquote>
</div>
</div>
</blockquote>
</div>
</blockquote>
</div>
</div>
</blockquote>
</div>
</blockquote>
</div>
</blockquote>
</div>
</blockquote></div>