[Openmp-dev] Target CUDA RTL --> CUDA error is: an illegal memory access was encountered

Doerfert, Johannes via Openmp-dev openmp-dev at lists.llvm.org
Sat Jan 11 22:26:03 PST 2020


Not good, this should work. Could you open a bug on this?

________________________________________
From: Itaru Kitayama <itaru.kitayama at gmail.com>
Sent: Sunday, January 12, 2020 00:22
To: Doerfert, Johannes
Cc: Alexey Bataev; openmp-dev
Subject: Re: [Openmp-dev] Target CUDA RTL --> CUDA error is: an illegal memory access was encountered

[kitayama1 at juronc12 ~]$ clang++ -fno-rtti -g -fopenmp -fopenmp-targets=nvptx64 test2.cpp
nvlink error   : Undefined reference to '__cxa_pure_virtual' in '/tmp/test2-ed87e2.cubin'
clang-10: error: nvlink command failed with exit code 255 (use -v to see invocation)

On Sun, Jan 12, 2020 at 3:20 PM Doerfert, Johannes <jdoerfert at anl.gov<mailto:jdoerfert at anl.gov>> wrote:
Can you try it with -fno-rtti.

________________________________________
From: Itaru Kitayama <itaru.kitayama at gmail.com<mailto:itaru.kitayama at gmail.com>>
Sent: Sunday, January 12, 2020 00:17
To: Doerfert, Johannes
Cc: Alexey Bataev; openmp-dev
Subject: Re: [Openmp-dev] Target CUDA RTL --> CUDA error is: an illegal memory access was encountered

This doesn't get compile:

class AbsBase {
virtual int f() = 0;
};
class Derived : public AbsBase {
private:
int a;
public:
int f() { a = 1; return a; }
};

int main() {
#pragma omp target parallel for
for (int i=0;i<10;i++) {
Derived d;
}
}

$ clang++ -g -fopenmp -fopenmp-targets=nvptx64 test2.cpp
nvlink error   : Undefined reference to '__cxa_pure_virtual' in '/tmp/test2-d564cf.cubin'
nvlink error   : Undefined reference to '_ZTVN10__cxxabiv117__class_type_infoE' in '/tmp/test2-d564cf.cubin'
nvlink error   : Undefined reference to '_ZTVN10__cxxabiv120__si_class_type_infoE' in '/tmp/test2-d564cf.cubin'
clang-10: error: nvlink command failed with exit code 255 (use -v to see invocation)


On Sun, Jan 12, 2020 at 1:45 PM Doerfert, Johannes <jdoerfert at anl.gov<mailto:jdoerfert at anl.gov><mailto:jdoerfert at anl.gov<mailto:jdoerfert at anl.gov>>> wrote:
On 01/12, Itaru Kitayama wrote:
> Do you guys have a timeframe for that feature
> Implemented?

I do not and I don't know anyone who will drive this right now.

As mentioned before, you should be able to "move/copy-create" the
elements on the device in order to use virtual functions.


> On Sun, Jan 12, 2020 at 12:51 Doerfert, Johannes <jdoerfert at anl.gov<mailto:jdoerfert at anl.gov><mailto:jdoerfert at anl.gov<mailto:jdoerfert at anl.gov>>> wrote:
>
> > On 01/11, Alexey Bataev via Openmp-dev wrote:
> > > Virtual functions are not supported.
> >
> > Not yet ;).
> >
> > We'll get it with 5.1 so we might actually implement it soon. Till then,
> > you have to create the object on the device you call the virtual
> > function.
> >

--

Johannes Doerfert
Researcher

Argonne National Laboratory
Lemont, IL 60439, USA

jdoerfert at anl.gov<mailto:jdoerfert at anl.gov><mailto:jdoerfert at anl.gov<mailto:jdoerfert at anl.gov>>


More information about the Openmp-dev mailing list