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

Itaru Kitayama via Openmp-dev openmp-dev at lists.llvm.org
Sat Jan 11 15:07:55 PST 2020


Hi,
C++ sample code like below:

class AbsBase {
public:
virtual int f() = 0;
};

class Derived : public AbsBase {
private:
int *arr = new int[100];
public:
int f() { return arr[0]; }
void fillarray() {
arr[0] = 1234;
}
};

int main() {
AbsBase *absBase = new Derived();
#pragma omp target enter data map(to: absBase[0:1])
#pragma omp target parallel for map(to: absBase)
for (int i=0;i<10;i++) {
static_cast<Derived*>(absBase)->f();
}
}

if it is built with the offloading support and executed on POWER8, I
observe illegal memory access. Am I programming incorrectly or the possible
bug in the
current trunk of Clang?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20200112/37d7c3a0/attachment.html>


More information about the Openmp-dev mailing list