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

Itaru Kitayama via Openmp-dev openmp-dev at lists.llvm.org
Fri Sep 27 18:16:50 PDT 2019


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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20190928/f8d06f0f/attachment.html>


More information about the Openmp-dev mailing list