<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body dir="auto">
1. If the is trivial, it is guaranteed to be offloaded correctly.  
<div>2. No, 5.0 does not add anything like this.<br>
<br>
<div dir="ltr">Best regards,
<div>Alexey Bataev</div>
</div>
<div dir="ltr"><br>
<blockquote type="cite">27 сент. 2019 г., в 21:59, Itaru Kitayama <itaru.kitayama@gmail.com> написал(а):<br>
<br>
</blockquote>
</div>
<blockquote type="cite">
<div dir="ltr">
<div>
<div dir="auto">Do you mean, depending the type it might be offloaded correctly? Is this situation improved once 5.0 API is supported in trunk?</div>
</div>
<div><br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Sat, Sep 28, 2019 at 10:22 Alexey Bataev <<a href="mailto:a.bataev@hotmail.com">a.bataev@hotmail.com</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Non trivial types are not guaranteed to be offloaded correctly. <br>
<br>
Best regards,<br>
Alexey Bataev<br>
<br>
> 27 сент. 2019 г., в 21:17, Itaru Kitayama via Openmp-dev <<a href="mailto:openmp-dev@lists.llvm.org" target="_blank">openmp-dev@lists.llvm.org</a>> написал(а):<br>
> <br>
> <br>
> Hi,<br>
> This simple C++ program:<br>
> <br>
> #include <iostream><br>
> <br>
> class Abstract {<br>
> public:<br>
>         virtual int f() = 0;<br>
> };<br>
> class Derived : public Abstract {<br>
>         public:<br>
>         int f() { return 1; };<br>
> };<br>
> <br>
> int main() {<br>
>         Abstract *p[10];<br>
>         for (int i=0;i<10;i++) {<br>
>             p[i] = new Derived;<br>
>         }<br>
>         int sum=0;<br>
> #pragma omp target parallel for map(p[:10]) reduction(+: sum)<br>
>         for (int i=0;i<10;i++) {<br>
>                 sum += p[i]->f();<br>
>         }<br>
>         std::cout << "sum " << sum << std::endl;<br>
> }<br>
> <br>
> can be built with the offloading flags of Clang and runs fine on host, but on<br>
> the device it crashes at runtime leaving the error message:<br>
> <br>
> ==60659== NVPROF is profiling process 60659, command: ./a.out<br>
> Libomptarget fatal error 1: failure of target construct while offloading is mandatory<br>
> ==60659== Profiling application: ./a.out<br>
> ==60659== Warning: 5 records have invalid timestamps due to insufficient device buffer space. You can configure the buffer space using the option --device-buffer-size.<br>
> ==60659== Warning: 4 records have invalid timestamps due to insufficient semaphore pool size. You can configure the pool size using the option --profiling-semaphore-pool-size.<br>
> ==60659== Profiling result:<br>
> No kernels were profiled.<br>
> <br>
> Does this just indicate the limitation of the current trunk Clang implementation?<br>
> <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>
</div>
</div>
</blockquote>
</div>
</body>
</html>