Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
공지
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29285 토론

SSE error in compilation with xHost option on AMD Zen 3 CPU

artu72
초급자
7,601 조회수

On a host with an AMD Ryzen 5800X CPU (zen 3 architecture), compiling a fortran 90 code with -xHost opion raises the error

catastrophic error: Function return parameter requires SSE register while SSE is disabled

corresponding to a row whit a square root of a quadruple precision floating point value.

If I replace -xHost option with a -march=core-avx2 one, the compilation goes fine. 

The compiler is ifort Version 2021.2.0 Build 20210228_000000

0 포인트
1 솔루션
Steve_Lionel
명예로운 기여자 III
7,532 조회수

If your CPU supports AVX2 (which it does), then yes, that's the right choice. It is what -xHost should do anyway. Do keep in mind that -fp-model:strict will reduce performance. You may want to use this only on the sources where you need that.

원본 게시물의 솔루션 보기

0 포인트
5 응답
Steve_Lionel
명예로운 기여자 III
7,578 조회수

Please provide an example source that demonstrates the problem. I'd also be interested in the output of compiling this source with the -# option (I'm not sure if that's the right one for Linux, but it might be.) I wrote the original compiler code to implement -xHost - it uses a CPUID instruction and looks at the feature bits returned if a non-Intel CPU. That was some years ago - the code may have been altered since then. But the -# output will at least show what features the driver THINKS the CPU has.

0 포인트
artu72
초급자
7,567 조회수

Thank you for your kind reply. Meanwhile, I have found that the culprit is the -fp-model strict option. By removing it, the compilation is ok. I attach here a sample code that reproduces the problematic part. By compiling it with

ifort -O3 -xHost test-amd.f90 -o test-amd -fp-model strict

there is the error. By removing -xHost or -fp-model strict option, it works. I attach here also the output generated by inserting -# option. As said before, by issuing

ifort -O3 -march=core-avx2 test-amd.f90 -o test-amd -fp-model strict

it works again.

UPDATE: the fp-model source option gives the same behavior as strict one.

0 포인트
Steve_Lionel
명예로운 기여자 III
7,555 조회수

Thanks. The output you attached shows that the compiler believes the processor supports SSE4 and AVX1, at least. You've identified a compiler bug, to be sure. Do you have purchased support? If so, I'd encourage you to report this at the Intel Online Service Center. If not, hope that one of the Intel support engineers sees this and picks it up. I'll comment that for Fortran, source and strict are the same (they aren't for Intel C++.)

0 포인트
artu72
초급자
7,550 조회수

Hi Steve, I will report the bug to the IT staff in my company, they have a corporate support. Thank you very much for the support. As workaround, can I use  -march=core-avx2 instead of -xHost to have the best code on my CPU?

0 포인트
Steve_Lionel
명예로운 기여자 III
7,533 조회수

If your CPU supports AVX2 (which it does), then yes, that's the right choice. It is what -xHost should do anyway. Do keep in mind that -fp-model:strict will reduce performance. You may want to use this only on the sources where you need that.

0 포인트
응답