https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98862

            Bug ID: 98862
           Summary: Complex reduction support in offload region
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: xw111luoye at gmail dot com
  Target Milestone: ---

Using std::complex type in offload region is highly desired.

$ g++ -fopenmp complex_reduction.cpp
ptxas /tmp/cceLNaYr.o, line 484; error   : Label expected for argument 0 of
instruction 'call'
ptxas /tmp/cceLNaYr.o, line 484; error   : Function '_ZNSt7complexIfEC1Eff' not
declared in this scope
ptxas /tmp/cceLNaYr.o, line 484; fatal   : Call target not recognized
ptxas fatal   : Ptx assembly aborted due to errors
nvptx-as: ptxas returned 255 exit status
mkoffload: fatal error: x86_64-pc-linux-gnu-accel-nvptx-none-gcc returned 1
exit status
compilation terminated.
lto-wrapper: fatal error:
/soft/gcc/gcc-11-dev-2021-01-27/bin/../libexec/gcc/x86_64-pc-linux-gnu/11.0.0//accel/nvptx-none/mkoffload
returned 1 exit status
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status

$ g++ -fopenmp -O2 complex_reduction.cpp
unresolved symbol __atomic_compare_exchange_16
collect2: error: ld returned 1 exit status
mkoffload: fatal error: x86_64-pc-linux-gnu-accel-nvptx-none-gcc returned 1
exit status
compilation terminated.
lto-wrapper: fatal error:
/soft/gcc/gcc-11-dev-2021-01-27/bin/../libexec/gcc/x86_64-pc-linux-gnu/11.0.0//accel/nvptx-none/mkoffload
returned 1 exit status
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status

The -O2 is more useful for production. Fixing both are desired.

source code:
https://github.com/ye-luo/openmp-target/blob/master/hands-on/tests/complex/complex_reduction.cpp

Reply via email to