-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Given the input:
#pragma omp target parallel for
for (int i = 0; i < n; ++i)
y[i] += a * x[i];If it's in a C file, the kernel is OK. Variable a is rewritten as *ap__ and used correctly.
__global__ void OUT__1__7822__axpy_omp__48__kernel__(long *np__,double *ap__,double *_dev_x,double *_dev_y) {
...
for (i = _dev_lower; ((long )i) <= _dev_upper; i += 1) {
_dev_y[i] += *ap__ * _dev_x[I]; // *ap__ is used. Correct.
}
}However, if the same OpenMP code is in a C++ file. The generated kernel would be:
__global__ void OUT__1__7822__axpy_omp__48__kernel__(long *np__,double *ap__,double *_dev_x,double *_dev_y) {
...
for (i = _dev_lower; ((long )i) <= _dev_upper; i += 1) {
_dev_y[i] += ap__ * _dev_x[i]; // ap__ is used. Incorrect.
}
}Please notice that ap__ is used as a pointer without dereferencing.
I've checked the lowering and outlining modules. So far, no C++-specific handler has been found.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working