- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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++.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page