- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Among the features that I like in oneApi C++ (classical) compiler, the option for a specific CPU architecture is what I use to specialize the executable for an Intel processor.
However, I am still confused by the options below for the Windows version (one of them is not fully documented for WIndows but it is accepted by icl.exe). For example:
- /arch:skylake
- /QaxSKYLAKE
- /QxSKYLAKE
- /tune:skylake
Which combination of the above options is best for the Skylake (or your favorite) architecture? My guess is the last three options: /QaxSKYLAKE /QxSKYLAKE /tune:skylake
Thank you
-Roberto
P.S. Some documentation is here:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
/arch and /tune are to be compatible with other compilers; whereas /Q[a]x are Intel's specific options.
/arch:skylake is equivalent to /QxSKYLAKE. It generates code exclusively for a given CPU. You will get "illegal instructions" error, if you try to run your binary on unsupported systems.
/tune:skylake is equivalent to /QaxSKYLAKE. This will generate multiple code paths, one path defaults to SSE2 and other path is to support Skylake (auto-dispatch code paths at runtime).
In general, there are some differences between /arch vs. /Qx or /tune vs. /Qax, because Intel compiler is a step ahead compares to other compilers in term of supporting new instruction set (added on later in the same code name).
Hence, we might support those new instructions with /Q[a]x options but not /tune nor /arch(for compatibility).
Sine you are specifically targeting Comet Lake processor, /Qx:SKYLAKE is the best choice.
Thanks,
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
/Qax generates multiple feature-specific code paths along with the baseline code. When you specify both /Qax and /Qx options, the /Qx option is essentially the baseline code path option (typically to support older processors).
Qx/Qax and arch are mutually exclusive. If both are specified, the compiler uses the last one specified and generates a warning (Intel-specific instruction set is not generated). The binaries produced by Qx/Qax will only run on Intel architectures whereas the code generated by the /arch option is compatible on non-intel architectures with support for the corresponding instruction set.
The /tune option performs optimization for specific processors and is backward compatible.
The best combination depends on your application. Please check the optimization report generated by /Qopt-report. You may also experiment by setting the instruction set as an option value for Qx/Qax.
Please find the documentation for these compiler options:
- /Qx
- /Qax
- /arch
- /tune
Thanks,
Rahul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you Rahul, my point is how to get the best from, say, SkyLake (micro)architecture. Sorry, from your answer it is unclear to me which one among the choices below is the best:
- /QaxSKYLAKE /QxSKYLAKE
- /QaxSKYLAKE
- /QxSKYLAKE
Regards
-Roberto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Believe it or not, compiling with /QaxSKYLAKE /QxSKYLAKE and /QxSKYLAKE /QaxSKYLAKE (just swapping the options) gives different outcomes. This is puzzling me. Let's wait for the 2021.2 upcoming release at this point.
-R
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Roberto,
Apologies for the late response.
>>Believe it or not, compiling with /QaxSKYLAKE /QxSKYLAKE and /QxSKYLAKE /QaxSKYLAKE (just swapping the options) gives different outcomes.
Could you please elaborate more on the various outcomes you get when you interchange these flags?
Regarding the best option (for a particular architecture), I need to check with the team on this internally. I will get back to you once I have the info.
Thanks,
Rahul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
/Qax option would better since it generates multiple code paths. The binary generated is also compatible with the older architectures since it involves the generation of the baseline code path. The only disadvantage could be a relatively large executable file.
Thanks,
Rahul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Rahul,
sorry for the late reply, and thank you for taking care of my question.
Just to clarify: I have a Comet Lake processor, and I would to exploit its features at its best. I do not want compatibility with other processors. I am using the code on the Comet Lake. If I need to run my code on another processor, I recompile it for that processor.
Intel C++ classic compiler offers four options: /arch, /Qx, /Qax and /tune.
If I compile with /Qax alone, it generates warnings. It takes as a default an SSE processor and extends it with dynamic paths. I am not sure this is the best way to exploit my Comet Lake processor.
Kind regards
-Roberto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I double checked the documentation and I am even more confused, sorry about that
If I just specify /Qax:SKYLAKE, this is equivalent to having also /arch:SSE2, as the latter is the default value.
Hence it could make sense to specify both /arch:SKYLAKE and /Qax:SKYLAKE. However, the documentation says that "If you specify both the /Qax and /arch options, the compiler will not generate Intel-specific instructions.". How is that possible, if SKYLAKE is a feasible option that is specific for Intel processors?
Would you be so kind to ask the developers of the Intel C++ classic compilers? They know the internals and can clarify this ambiguity
Kind regards
-Roberto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
As rightly pointed out, it is unclear from the documentation whether the Intel-specific instructions will not be generated only for the baseline code path or even for the /Qax specific path.
I will check with the developers on this and get back to you once I have the information.
Thanks for bringing this up.
Regards,
Rahul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you Rahul for asking. I am currently using /qx:SKYLAKE /tune:skylake
Kind regards
Roberto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
/arch and /tune are to be compatible with other compilers; whereas /Q[a]x are Intel's specific options.
/arch:skylake is equivalent to /QxSKYLAKE. It generates code exclusively for a given CPU. You will get "illegal instructions" error, if you try to run your binary on unsupported systems.
/tune:skylake is equivalent to /QaxSKYLAKE. This will generate multiple code paths, one path defaults to SSE2 and other path is to support Skylake (auto-dispatch code paths at runtime).
In general, there are some differences between /arch vs. /Qx or /tune vs. /Qax, because Intel compiler is a step ahead compares to other compilers in term of supporting new instruction set (added on later in the same code name).
Hence, we might support those new instructions with /Q[a]x options but not /tune nor /arch(for compatibility).
Sine you are specifically targeting Comet Lake processor, /Qx:SKYLAKE is the best choice.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you Viet_H, I will drop /tune:skylake and just keep /Qx:SKYLAKE.
Regards
-Roberto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Roberto,
This issue has been resolved and we will no longer respond to this thread. If you require additional assistance from Intel, please start a new thread. Any further interaction in this thread will be considered community only.
Thanks,

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page