# How to correctly determine the \`-march\` flag when working with Intel oneAPI on Intel processors?

**URL:** <https://fortran-lang.discourse.group/t/how-to-correctly-determine-the-march-flag-when-working-with-intel-oneapi-on-intel-processors/2826>\
**Category:** Help\
**Created:** [February 19, 2022, 3:03am UTC](https://fortran-lang.discourse.group/t/how-to-correctly-determine-the-march-flag-when-working-with-intel-oneapi-on-intel-processors/2826 "2022-02-19T03:03:47Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![sblionel](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/sblionel/32/853_2.png) [@sblionel](https://fortran-lang.discourse.group/u/sblionel)\
**Post date:** [February 20, 2022, 3:56pm UTC](https://fortran-lang.discourse.group/t/how-to-correctly-determine-the-march-flag-when-working-with-intel-oneapi-on-intel-processors/2826/13 "2022-02-20T15:56:24Z")

</div>

The issue you linked doesn’t suggest that `-xHost` “doesn’t work”, but rather that it is inappropriate for a mixed execution environment.

What `-xHost` does (I know, because I’m the one who implemented it) is query the CPU type. If it is an Intel processor, it applies the appropriate `-x` option for that processor, and that includes a check at the start of execution that the program is running on an Intel processor supporting the specified instruction set (or larger). If the compiling CPU is non-Intel, then it applies the appropriate `-march` option and omits the startup check. Even with `-march`, if you execute on a processor that doesn’t support the same instruction set as the compiling processor, the program may fail with an invalid instruction fault.

(Note that “Intel optimizations, for Intel compilers or other products, may not optimize to the same degree for non-Intel products.” [Performance Index (intel.com)](https://edc.intel.com/content/www/us/en/products/performance/benchmarks/overview/?r=322126669))

---

_[View the full topic](https://fortran-lang.discourse.group/t/how-to-correctly-determine-the-march-flag-when-working-with-intel-oneapi-on-intel-processors/2826)._
