public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/98862] New: Complex reduction support in offload region
@ 2021-01-28 3:14 xw111luoye at gmail dot com
2021-01-28 13:06 ` [Bug target/98862] " jakub at gcc dot gnu.org
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: xw111luoye at gmail dot com @ 2021-01-28 3:14 UTC (permalink / raw)
To: gcc-bugs
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug target/98862] Complex reduction support in offload region
2021-01-28 3:14 [Bug c++/98862] New: Complex reduction support in offload region xw111luoye at gmail dot com
@ 2021-01-28 13:06 ` jakub at gcc dot gnu.org
2021-01-28 14:18 ` burnus at gcc dot gnu.org
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-01-28 13:06 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98862
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |burnus at gcc dot gnu.org,
| |jakub at gcc dot gnu.org
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
libstdc++-v3 isn't supported ATM on either nvptx* or amdgcn* offloading, so if
one needs anything from libstdc++, it will not work.
As for the 16 byte atomics, I thought this was meant to be solved through
-latomic, but I might misremember.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug target/98862] Complex reduction support in offload region
2021-01-28 3:14 [Bug c++/98862] New: Complex reduction support in offload region xw111luoye at gmail dot com
2021-01-28 13:06 ` [Bug target/98862] " jakub at gcc dot gnu.org
@ 2021-01-28 14:18 ` burnus at gcc dot gnu.org
2021-01-28 18:39 ` xw111luoye at gmail dot com
2022-09-08 18:51 ` xw111luoye at gmail dot com
3 siblings, 0 replies; 5+ messages in thread
From: burnus at gcc dot gnu.org @ 2021-01-28 14:18 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98862
--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #1)
> libstdc++-v3 isn't supported ATM on either nvptx* or amdgcn* offloading, so
> if one needs anything from libstdc++, it will not work.
I can confirm that it does not work with '-O0', showing that the
symbol
_ZNSt7complexIfEC1Eff
alias
std::complex<float>::complex(float, float)
is missing.
But:
> As for the 16 byte atomics, I thought this was meant to be solved through
> -latomic, but I might misremember.
Yes,
$ g++ -fopenmp -O2 complex_reduction.cpp -foffload=-latomic
works – both compiling and running (on nvptx).
Note the added '-foffload=-latomic' (and -O2).
See also: https://gcc.gnu.org/wiki/Offloading#Compilation_options
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug target/98862] Complex reduction support in offload region
2021-01-28 3:14 [Bug c++/98862] New: Complex reduction support in offload region xw111luoye at gmail dot com
2021-01-28 13:06 ` [Bug target/98862] " jakub at gcc dot gnu.org
2021-01-28 14:18 ` burnus at gcc dot gnu.org
@ 2021-01-28 18:39 ` xw111luoye at gmail dot com
2022-09-08 18:51 ` xw111luoye at gmail dot com
3 siblings, 0 replies; 5+ messages in thread
From: xw111luoye at gmail dot com @ 2021-01-28 18:39 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98862
--- Comment #3 from Ye Luo <xw111luoye at gmail dot com> ---
Cool. -foffload=-latomic resolved my problem.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug target/98862] Complex reduction support in offload region
2021-01-28 3:14 [Bug c++/98862] New: Complex reduction support in offload region xw111luoye at gmail dot com
` (2 preceding siblings ...)
2021-01-28 18:39 ` xw111luoye at gmail dot com
@ 2022-09-08 18:51 ` xw111luoye at gmail dot com
3 siblings, 0 replies; 5+ messages in thread
From: xw111luoye at gmail dot com @ 2022-09-08 18:51 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98862
Ye Luo <xw111luoye at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #4 from Ye Luo <xw111luoye at gmail dot com> ---
No fix needed.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-09-08 18:51 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-28 3:14 [Bug c++/98862] New: Complex reduction support in offload region xw111luoye at gmail dot com
2021-01-28 13:06 ` [Bug target/98862] " jakub at gcc dot gnu.org
2021-01-28 14:18 ` burnus at gcc dot gnu.org
2021-01-28 18:39 ` xw111luoye at gmail dot com
2022-09-08 18:51 ` xw111luoye at gmail dot com
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).