<?xml version="1.0"?>
<!DOCTYPE flagsdescription SYSTEM
       "http://www.spec.org/dtd/cpuflags2.dtd">

<!-- This file defines flags for use with the NVIDIA HPC 2021 Linux Compilers -->
<flagsdescription>
<filename>Intel_compiler_flags</filename>
<title>Intel Compiler, Optimization and Other flags for use by SPEChpc</title>

<!-- Style -->

<style>
<![CDATA[
body {
  margin:  1em;
  border:  0;
  padding: 0;
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-position: 100% 0;
  color:      black;
  font-family: "Times Roman", times, serif;
}

div.flagDesc {
  clear: both;
  color: black;
  background-color: #d6e7f7;
  border: 1px solid #blue;
  margin: 0 auto;
  width: 90%;
}

ul.flagTOC {
  list-style-type: none;
  margin: 0;
  padding: 0;
}

ul.flagTOC > li {
  border: 1px solid #d6e7f7;
  background: #d6e7f7;
}

ul.flagTOC > li > a:link {
   color: blue;
}

ul.SubMenu li {
  border: 1px solid #d6e7f7; /* rgb(211, 211, 211); */
}

ul.SubMenu {
  border: 1px solid blue;
  background-color: #d6e7f7;
}
]]>
</style>

<!-- Header -->

<header>
<![CDATA[
<div id='banner'>
<h2><b>Compilers: Intel Fortran/C/C++</b></h2>
<h2><b>Operating systems: Linux</b></h2>
</div>
]]>
</header>

<!-- Compilers -->
<flag name='mpifort' class='compiler' regexp="mpifort\b" >
<![CDATA[
 <p>The OpenMPI Fortran driver configured for use with the Intel Fortran compiler.</p>
 ]]>
<example>mpifort</example>
</flag>

<flag name='mpicxx' class='compiler' regexp="mpicxx">
<![CDATA[
 <p>The OpenMPI C++ driver configured for use with the Intel C++ compiler.</p>
 ]]>
<example>mpicxx</example>
</flag>
  
<flag name='mpicc' class='compiler' regexp="mpicc">
<![CDATA[
 <p>The OpenMPI C driver configured for use with the Intel C compiler.</p>
 ]]>
<example>mpicc</example>
</flag>



<flag name='mpiifort' class='compiler' regexp="mpiifort.* -fc=ifx\b" >
<![CDATA[
 <p>The Intel MPI Fortran driver configured for use with the Intel Fortran compiler.</p>
 ]]>
<example>mpiifort</example>
</flag>

<flag name='mpiicpc' class='compiler' regexp="mpiicpc.* -cxx=icpx">
<![CDATA[
 <p>The Intel MPI C++ driver configured for use with the Intel C++ compiler.</p>
 ]]>
<example>mpiicpc</example>
</flag>

<flag name='mpiicc' class='compiler' regexp="mpiicc.* -cc=icx">
<![CDATA[
 <p>The Intel MPI C driver configured for use with the Intel C compiler.</p>
 ]]>
<example>mpiicc</example>
</flag>



<!-- Portability, Other Flags. -->
<flag name="lstdc" class="portability"
        compilers="mpicc, mpicxx, mpifort, mpiicc, mpiicpc, mpiifort"
        regexp="-lstdc\+\+">
        <![CDATA[
        <p>USE std C++ libs on Linker </p>
        ]]>
</flag>



<flag name="DSPEC_LP64" class="portability"
	compilers="mpicc, mpicxx, mpifort, mpiicc, mpiicpc, mpiifort" 
	regexp="-DSPEC_LP64">
	<![CDATA[
	<p>  </p>
	]]>
</flag>

<flag name="D_OPENMP201411" class="portability"
	compilers="mpicc, mpicxx, mpifort, mpiicc, mpiicpc, mpiifort"
	regexp="-D_OPENMP=201411\b">
	<![CDATA[
        	<p> 
			Disable use of reduction with variable array reduction variable (OpenMP 4.5,
OpenACC 2.7) even if compiler reports support. 
		</p>
        ]]>
</flag>


<flag name="DSPEC_NO_VAR_ARRAY_REDUCE" class="portability"
	compilers="mpicc, mpicxx, mpifort, mpiicc, mpiicpc, mpiifort"
	regexp="-DSPEC_NO_VAR_ARRAY_REDUCE\b">
	<![CDATA[
        	<p>
			Disable use of reduction with variable array reduction variable (OpenMP 4.5,
OpenACC 2.7) even if compiler reports support.
		</p>
        ]]>
</flag>


<flag name="c99" class="portability"
compilers="mpicc, mpicxx, mpifort" regexp="-std=c99\b">
<![CDATA[
 <p>Use C99 language features.</p>
]]>
<example>--c++14</example></flag>

<flag name="cxx17" class="portability"
compilers="mpicxx" regexp="--c\+\+17\b">
<![CDATA[
 <p>Use C++ 17 language features.</p>
]]>
<example>--c++17</example></flag>

<flag name="cxx14" class="portability"
compilers="mpicxx" regexp="--c\+\+14\b">
<![CDATA[
 <p>Use C++ 14 language features.</p>
]]>
<example>--c++14</example></flag>

<!-- Fortran Optimization Flags -->
<flag name="align64" class="optimization" regexp="-align array64byte">
<example>-align array64byte specifies that analyzed arrays should be aligned to 64byte boundaries</example>
<![CDATA[ <p>The align toggle changes how data elements are aligned. Variables and arrays are analyzed and memory layout can be altered. Specifying array64byte will look for opportunities to transform and reailgn arrays to 64byte boundaries.</p> ]]>
</flag>

<flag name="f_2003_std_realloc" class="optimization" regexp="-nostandard-realloc-lhs(?=\s|$)">
<example>Determines whether the compiler uses the current Fortran Standard rules or the old Fortran 2003 rules when interpreting assignment statements.</example>
<![CDATA[ <p>Option standard-realloc-lhs (the default), tells the compiler that when the left-hand side of an assignment is an allocatable object, it should be reallocated to the shape of the right-hand side of the assignment before the assignment occurs. This is the current Fortran Standard definition. This feature may cause extra overhead at run time. This option has the same effect as option assume realloc_lhs.</p> <p>If you specify nostandard-realloc-lhs, the compiler uses the old Fortran 2003 rules when interpreting assignment statements. The left-hand side is assumed to be allocated with the correct shape to hold the right-hand side. If it is not, incorrect behavior will occur. This option has the same effect as option assume norealloc_lhs.</p> ]]>
</flag>


<!-- Optimization Flags -->
<flag name="mprefer-vector-width-512" class="optimization" regexp="-mprefer-vector-width=512">
   <![CDATA[
      <p> Specifies preferred 512b vector width for auto-vectorization. Defaults to 'none' which allows target specific decisions.</p>
   ]]>
</flag>


<flag name="f-ipo" class="optimization" regexp="-ipo\b">
   <![CDATA[
      <p>Multi-file ip optimizations that includes:<br />
       - inline function expansion<br />
       - interprocedural constant propogation<br />
       - dead code elimination<br />
       - propagation of function characteristics<br />
       - passing arguments in registers<br />
       - loop-invariant code motion</p>
   ]]>
</flag>

<flag name="f-no-prec-div" class="optimization" regexp="-no-prec.div">
(disable/enable[default] -[no-]prec-div)

   <![CDATA[
      <p>-prec-div improves precision of floating-point divides. It has a slight
impact on speed. -no-prec-div disables this option and enables
optimizations that give slightly less precise results than full IEEE
division.</p>

<p>When you specify -no-prec-div along with some optimizations, such as
-xN and -xB (Linux) or /QxN and /QxB (Windows),
the compiler may change floating-point division computations into multiplication
by the reciprocal of the denominator.
For example, A/B is computed as A * (1/B) to improve the speed of the
computation.</p>
<p>However, sometimes the value produced by this transformation is
not as accurate as full IEEE division. When it is important to have fully
precise IEEE division, do not use -no-prec-div which will enable the
default -prec-div and the result is more accurate, with some
loss of performance.</p>
   ]]>

</flag>

<flag name="f-ansi-alias" class="optimization" regexp="-ansi-alias\b">
      Enable/disable(DEFAULT) use of ANSI aliasing rules in
      optimizations; user asserts that the program adheres to
      these rules.
</flag>

<flag name="CORE-AVX2" class="optimization" regexp="-march=core-avx2(?=\s|$)">

   <![CDATA[

   <p>May generate Intel® AVX2, AVX, SSE4.2, SSE4.1, SSSE3, SSE3, SSE2 and SSE instructions for Intel® procesr.
      Optimizes for 4th, 5th and 6th generation Intel® Co processors
      and the Intel® Xeon® Processor E3 v3, E5 v3, E7 v3, E3 v4, E5 v4 and E7 v4 familie
      Available in compiler versions 13 and later.</p>
   ]]>
</flag>

<flag name="xCORE-AVX512" class="optimization" regexp="-xCORE-AVX512(?=\s|$)">

   <![CDATA[
      <p>Code is optimized for Intel(R) processors with support for AVX instructions.
      May generate Intel® AVX-12 Foundation instructions,Intel® AVX-512 Conflict Detectio
      instructions, Intel® AVX-512 Doubleword and Quadword instructions, Intel® AVX-51
      Byte and Word instructions, Intel® AVX-512 Vector Length extensions, Intel® AVX2,VX
      SSE4.2, SSE4.1, SSSE3, SSE3, SSE2 and SSE instructions for Intel® processors.
      Optimizes for a future Intel® processor. Available in compiler version 15 update 1
      and later. </p>
   ]]>
</flag>

<flag name="fiopenmp" class="optimization"
 compilers="mpicc, mpicxx, mpifort, mpiicc, mpiicpc, mpiifort"
 regexp="-fiopenmp\b">
<![CDATA[
<p>Enable the compiler to generate multi-threaded code based on the OpenMP* directives. Similar behavior was granted by -qopenmp in previous versions.</p>
]]>
</flag>

<flag name="qopenmp" class="optimization"
 compilers="mpicc, mpicxx, mpifort, mpiicc, mpiicpc, mpiifort"
 regexp="-qopenmp\b">
<![CDATA[
<p>Enable OpenMP compilation for hpc2021.</p>
]]>
</flag>

<flag name="DSPEC_OPENMP" class="optimization"
 compilers="mpicc, mpicxx, mpifort, mpiicc, mpiicpc, mpiifort"
 regexp="-DSPEC_OPENMP\b">
<![CDATA[
<p>Enable OPENMP programming model for hpc2021.</p>
]]>
</flag>



<flag name="Ofast" 
  class="optimization" 
  compilers="mpicc, mpicxx, mpifort, mpiicc, mpiicpc, mpiifort" 
  regexp="-Ofast?s?e?\b">
<![CDATA[
 <p>Chooses generally optimal flags for the target platform.</p>
 ]]>
<example>-Ofast</example>
</flag>



<flag name="W"
  class="other"
  compilers="mpicc, mpicxx, mpifort, mpiicc, mpiicpc, mpiifort"
  regexp="-W.*">
<![CDATA[
 <p>Enable the specified warning.</p>
 ]]>
<example>-Wno-incompatible-function-pointer-types</example>
</flag>

<flag name="heap-arrays"
  class="optimization"
  compilers="mpicc, mpicxx, mpifort, mpiicc, mpiicpc, mpiifort"
  regexp="-heap-arrays.*">
<![CDATA[
 <p>Puts automatic arrays and arrays created for temporary computations on the heap instead of the stack.</p>
 ]]>
<example>-heap-arrays 32768</example>
</flag>

</flagsdescription>
