aomp icon indicating copy to clipboard operation
aomp copied to clipboard

std::complex support needed

Open ye-luo opened this issue 5 years ago • 8 comments

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

$ clang++ -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa -march=native -Xopenmp-target=amdgcn-amd-amdhsa -march=gfx906 complex.cpp 
lld: error: undefined symbol: __mulsc3
>>> referenced by /tmp/complex-gfx906-72c03e-gfx906-c2b83e.o:(__omp_offloading_10304_2920ae4__Z8test_mulIfSt7complexIfES1_EvT0_T1__l59)
>>> referenced by /tmp/complex-gfx906-72c03e-gfx906-c2b83e.o:(__omp_offloading_10304_2920ae4__Z8test_mulIfSt7complexIfES1_EvT0_T1__l59)

lld: error: undefined symbol: __divsc3
>>> referenced by /tmp/complex-gfx906-72c03e-gfx906-c2b83e.o:(__omp_offloading_10304_2920ae4__Z8test_divIfSt7complexIfES1_EvT0_T1__l76)
>>> referenced by /tmp/complex-gfx906-72c03e-gfx906-c2b83e.o:(__omp_offloading_10304_2920ae4__Z8test_divIfSt7complexIfES1_EvT0_T1__l76)
>>> referenced by /tmp/complex-gfx906-72c03e-gfx906-c2b83e.o:(__omp_offloading_10304_2920ae4__Z8test_divIffSt7complexIfEEvT0_T1__l76)
>>> referenced by /tmp/complex-gfx906-72c03e-gfx906-c2b83e.o:(__omp_offloading_10304_2920ae4__Z8test_divIffSt7complexIfEEvT0_T1__l76)

lld: error: undefined symbol: __muldc3
>>> referenced by /tmp/complex-gfx906-72c03e-gfx906-c2b83e.o:(__omp_offloading_10304_2920ae4__Z8test_mulIdSt7complexIdES1_EvT0_T1__l59)
>>> referenced by /tmp/complex-gfx906-72c03e-gfx906-c2b83e.o:(__omp_offloading_10304_2920ae4__Z8test_mulIdSt7complexIdES1_EvT0_T1__l59)

lld: error: undefined symbol: __divdc3
>>> referenced by /tmp/complex-gfx906-72c03e-gfx906-c2b83e.o:(__omp_offloading_10304_2920ae4__Z8test_divIdSt7complexIdES1_EvT0_T1__l76)
>>> referenced by /tmp/complex-gfx906-72c03e-gfx906-c2b83e.o:(__omp_offloading_10304_2920ae4__Z8test_divIdSt7complexIdES1_EvT0_T1__l76)
>>> referenced by /tmp/complex-gfx906-72c03e-gfx906-c2b83e.o:(__omp_offloading_10304_2920ae4__Z8test_divIddSt7complexIdEEvT0_T1__l76)
>>> referenced by /tmp/complex-gfx906-72c03e-gfx906-c2b83e.o:(__omp_offloading_10304_2920ae4__Z8test_divIddSt7complexIdEEvT0_T1__l76)
clang-11: error: amdgcn-link command failed with exit code 1 (use -v to see invocation)

ye-luo avatar Apr 15 '20 04:04 ye-luo

For host execution, which library is used for these complex functions. Is it -lm or something like -lboost? What is your command line for compiling complex.cpp?

gregrodgers avatar Apr 15 '20 16:04 gregrodgers

The command line on the first line in the description. I tried removing the offload options and get the following.

$ nm a.out |grep muldc
                 U __muldc3@@GCC_4.0.0

from /lib/x86_64-linux-gnu/libgcc_s.so.1

ye-luo avatar Apr 15 '20 17:04 ye-luo

Thanks Ye Luo. Jan is going to try to get this fixed with the math lib soon.

gregrodgers avatar Apr 15 '20 17:04 gregrodgers

FWIW, this is the fix for upstream: https://reviews.llvm.org/D80897

jdoerfert avatar Jul 02 '20 23:07 jdoerfert

I added the upstream code to our libm recently.

jsjodin avatar Jul 23 '20 19:07 jsjodin

11.7-1 works with default optimization, -O3, -O3 -ffast-math. As long as I add -g, the compiler stops.

ye-luo avatar Jul 30 '20 00:07 ye-luo

I tried with -g, it is very slow, but it doesn't stop. After some time I was getting an error in the Dwarf emitter instead.

jsjodin avatar Jul 30 '20 15:07 jsjodin

Assertion `DwarfRegs.size() == 1' failed.

I believe we saw this on another smoke test. We will work on this soon.

gregrodgers avatar Nov 30 '20 14:11 gregrodgers

Works fine with 17.0-1

ye-luo avatar Apr 28 '23 15:04 ye-luo