[Openmp-dev] Libomptarget fatal error 1: failure of target construct while offloading is mandatory

Doerfert, Johannes via Openmp-dev openmp-dev at lists.llvm.org
Sat Sep 28 18:02:24 PDT 2019


It is worth to note that we are working to support virtual methods in 5.1.
However, it is not voted on yet (afaik) and I doubt it'll make it in the TR9 that is release for SC (Nov).

Also:
  - If you map a non-trivial type but use it only as if it was a trivial one, e.g., no virtual function calls, it should work.
  - If you allocate a non-trivial type on a device (incl. the host) and use it on that device only, it should work.

@Ravi,  please correct me if I'm wrong.

________________________________________
From: Openmp-dev <openmp-dev-bounces at lists.llvm.org> on behalf of Itaru Kitayama via Openmp-dev <openmp-dev at lists.llvm.org>
Sent: Friday, September 27, 2019 20:59
To: Alexey Bataev
Cc: openmp-dev
Subject: Re: [Openmp-dev] Libomptarget fatal error 1: failure of target construct while offloading is mandatory

Do you mean, depending the type it might be offloaded correctly? Is this situation improved once 5.0 API is supported in trunk?

On Sat, Sep 28, 2019 at 10:22 Alexey Bataev <a.bataev at hotmail.com<mailto:a.bataev at hotmail.com>> wrote:
Non trivial types are not guaranteed to be offloaded correctly.

Best regards,
Alexey Bataev

> 27 сент. 2019 г., в 21:17, Itaru Kitayama via Openmp-dev <openmp-dev at lists.llvm.org<mailto:openmp-dev at lists.llvm.org>> написал(а):
>
> 
> Hi,
> This simple C++ program:
>
> #include <iostream>
>
> class Abstract {
> public:
>         virtual int f() = 0;
> };
> class Derived : public Abstract {
>         public:
>         int f() { return 1; };
> };
>
> int main() {
>         Abstract *p[10];
>         for (int i=0;i<10;i++) {
>             p[i] = new Derived;
>         }
>         int sum=0;
> #pragma omp target parallel for map(p[:10]) reduction(+: sum)
>         for (int i=0;i<10;i++) {
>                 sum += p[i]->f();
>         }
>         std::cout << "sum " << sum << std::endl;
> }
>
> can be built with the offloading flags of Clang and runs fine on host, but on
> the device it crashes at runtime leaving the error message:
>
> ==60659== NVPROF is profiling process 60659, command: ./a.out
> Libomptarget fatal error 1: failure of target construct while offloading is mandatory
> ==60659== Profiling application: ./a.out
> ==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.
> ==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.
> ==60659== Profiling result:
> No kernels were profiled.
>
> Does this just indicate the limitation of the current trunk Clang implementation?
>
> _______________________________________________
> Openmp-dev mailing list
> Openmp-dev at lists.llvm.org<mailto:Openmp-dev at lists.llvm.org>
> https://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev


More information about the Openmp-dev mailing list