[Openmp-dev] virtual destructor prevents an object being created on the device

Itaru Kitayama via Openmp-dev openmp-dev at lists.llvm.org
Wed Mar 25 16:57:29 PDT 2020


Below code can't be built with OpenMP offloading flags enabled:

class Base {
public:
virtual void operator()() = 0;
};

class Derived : Base {
public:
void operator()();
};
int main() {
#pragma omp target parallel for
for (int i =0;i<100;i++) {
Derived d;
}

}

On Wed, Mar 25, 2020 at 11:47 PM Alexey.Bataev <a.bataev at outlook.com> wrote:

> What doy you see and what do you expect? Could you provide a reproducer?
>
> -------------
> Best regards,
> Alexey Bataev
>
> 25.03.2020 1:19 AM, Itaru Kitayama via Openmp-dev пишет:
>
> I would like to know why a class that has virtual destructor can not be
> instantiated on the device while virtual methods are ok.
>
> _______________________________________________
> Openmp-dev mailing listOpenmp-dev at lists.llvm.orghttps://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20200326/97ec7ca1/attachment.html>


More information about the Openmp-dev mailing list