Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Which /Qx switch?

YertleTheTurtle
Beginner
644 Views
I have a program that is used throughout the industry on many different types of machines, all running various versions of Windows. Execution speed is of the essence.

So, when I compile the release version I see 3 different switches to be set.

1. Enable Enhanced Instruction set: My choice here would be /arch:IA32 to guarantee that the program will at least run on any machine that is out there.

2. Add processor-optimized code path: Here there are 5 choices and the probable one is /QaxSSE2.

If I understand correctly, this choice of the two options will provide alternate execution paths, so if a machine is SSE2 enabled (or higher), the program will use the SSE2 capability, and if it isn't enabled, it will still run with the IA32 architechture.

Q1. Is this understanding correct?
Q2. Is there any penalty associated with providing alternate execution paths inside the code?
Q3. What happens if I specify /arch:IA32 and /QaxSSe3 and the machine is only SSE2 enabled ?

Then there is the third set - Qx options. The instructions say that these will only generate specific machine dependent code. There are 6 possibilities.

Q4. What happens if I choose options that are incompatible, say /arch:IA32, /QaxSSE2 and /QxSSE3 ?

If there is a significant speedup to be obtained by using the advanced architecture available on a specific machine, I want my users to have it. I am willing to provide the user with 5 different executables specific to machines that have the five different archtectures listed (SSE3 and above), but most of my users would not understand the question if asked them to use a specific executable depending on their machine.

But, I could easily write a master program that spawned the correct executable if the SIMD architecture information could be obtained at run-time.

Q5. How does one query a machine to determine the SIMD architecture that is present ?

The Intel compiler does it, so it must be possible.

Thank you.

No enhanced instruction sets (/arch:IA32)
0 Kudos
1 Reply
Steven_L_Intel1
Employee
644 Views
Q1. If it is an Intel processor system that supports SSE2, then yes, it will use SSE2, otherwise it will use generic IA-32 instructions.

Q2. Hard to say. It does make the code bigger, but it depends on what the program does. There is also a small penalty involved to do the switching.

Q3. You get IA-32.

Q4. Generally options to the right override those on the left. In the case you specify, either the compiler will complain or you'll just get /QxSSE3.

I believe there is a limit of three code paths. The way I look at it is that users concened about performance will have recent processors. You really should establish SSE2 as a minimum (this is the compiler default), as it has the most benefit.

Q5. The CPUID instruction
0 Kudos
Reply