https://bugs.llvm.org/show_bug.cgi?id=52109

            Bug ID: 52109
           Summary: Incorrect data sharing analysis leads to kernel crash
           Product: OpenMP
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Clang Compiler Support
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

https://godbolt.org/z/4o7fbPbYW

First, the compiler finds data sharing, which is incorrect.  There's no sharing
of these stack variables.

example.cpp:820:62: remark: Found thread data sharing on the GPU. Expect
degraded performance due to data globalization. [OMP112]
[-Rpass-missed=openmp-opt]
                ColorSpinor<typename Arg::realIn, Arg::nColor, Arg::nSpin> in =
arg.in(x_cb, (parity+arg.inParity)&1);
                                                                           ^
example.cpp:821:63: remark: Found thread data sharing on the GPU. Expect
degraded performance due to data globalization. [OMP112]
[-Rpass-missed=openmp-opt]
                ColorSpinor<typename Arg::realOut, Arg::nColor, Arg::nSpin>
out;
                                                                            ^
example.cpp:665:8: remark: Found thread data sharing on the GPU. Expect
degraded performance due to data globalization. [OMP112]
[-Rpass-missed=openmp-opt]
                real v[length];
                     ^
example.cpp:682:8: remark: Found thread data sharing on the GPU. Expect
degraded performance due to data globalization. [OMP112]
[-Rpass-missed=openmp-opt]
                real v[length];
                     ^

Second, the generated code crashes in kernels, with

CUDA error: an illegal memory access was encountered

Close inspections (debug by commenting out code) show that some of the accesses
to the above variables caused the illegal memory access.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to