https://bugs.llvm.org/show_bug.cgi?id=46146
Bug ID: 46146
Summary: Offload reduction of std::complex gives wrong result
when user defined reduction is missing
Product: OpenMP
Version: unspecified
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Clang Compiler Support
Assignee: unassignedclangb...@nondot.org
Reporter: xw111lu...@gmail.com
CC: llvm-bugs@lists.llvm.org
https://github.com/ye-luo/openmp-target/blob/master/hands-on/tests/complex/complex_reduction.cpp
On CPU with and without user defined reduction (UDR) always work.
$ clang++ -fopenmp ./complex_reduction.cpp
$ clang++ -fopenmp -D__NO_UDR ./complex_reduction.cpp
On GPU, the code works with UDR.
$ clang++ -fopenmp -fopenmp-targets=nvptx64 ./complex_reduction.cpp
with outUDR, it gives wrong result.
$ clang++ -fopenmp -fopenmp-targets=nvptx64 -D__NO_UDR ./complex_reduction.cpp
$ ./a.out
wrong reduction value check(0,0) correct value (4950,-4950)
wrong reduction value check(-3.42281e-49,7.67314e-308) correct value
(4950,-4950)
This is not expected. The code should either not compile and ask UDR or works
with correct numbers without UDR just like the CPU case.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs