<?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>nv2021_flags</filename>
<title>NVIDIA HPC SDK Compilers 2021.  Optimization, Compiler, 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: PGI Accelerator Fortran/C/C++ Server</b></h2>
<h2><b>Operating systems: Linux</b></h2>
</div>
]]>
</header>

<!-- Compilers -->

<flag name='mpicxx' class='compiler' regexp="mpicxx">
<![CDATA[
 <p>The OpenMPI C++ driver configured for use with the NVIDIA HPC C++ compiler (nvc++).</p>
 ]]>
<example>mpic++</example>
</flag>
  
<flag name='mpicc' class='compiler' regexp="mpicc" >
<![CDATA[
 <p>The OpenMPI C driver configured for use with the NVIDIA HPC C compiler (nvc).</p>
 ]]>
<example>pgcc</example>
</flag>

<flag name='mpif90' class='compiler' regexp="mpif90\b" >
<![CDATA[
 <p>The OpenMPI Fortran driver configured for use with the NVIDIA HPC Fortran compiler (nvfortran).</p>
 ]]>
<example>pgfortran</example>
</flag>

<!-- Portability, Other Flags. -->

<flag name="w" class="other"
 compilers="mpicc, mpicxx, mpif90" regexp="-w\b">
<![CDATA[
 <p>Disable warning messages.</p>
]]>
<example>-w</example>
</flag>

<flag name="Mnomain" class="optimization"
 compilers="mpif90" 
 regexp="-Mnomain\b">
<![CDATA[
 <p>Don't include Fortran main program object module.</p>
]]>
<example>-Mnomain</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>

<!-- Optimization Flags -->


<flag name="fast" 
  class="optimization" 
  compilers="mpicc, mpicxx,mpif90" 
  regexp="-fasts?s?e?\b">
<![CDATA[
 <p>Chooses generally optimal flags for the target platform.</p>
 ]]>
<example>-fast</example>
<include flag="O2" />
<include flag="Munroll_c_n" flagtext="-Munroll=c:1" />
<include flag="Mautoinline" />
<include flag="Mlre" />
<include flag="Mvect_sse" />
<include flag="Mcache_align" />
<include flag="Mflushz" />
</flag>

<flag name="no-exceptions" 
 class="optimization" 
 compilers="mpicxx" 
 regexp="--no_exceptions\b">
<![CDATA[
 <p>Disable C++ exception handling support.</p>
 ]]>
<example>--no_exceptions</example>
</flag>

<flag name="no-rtti" 
 class="optimization" 
 compilers="mpicxx" 
 regexp="--no_rtti\b">
<![CDATA[
 <p>Disable C++ run time type information support.</p>
 ]]>
<example>--no_rtti</example>
</flag>

<flag name="zc_eh" class="optimization"
 compilers="mpicxx"
 regexp="--zc_eh\b">
<![CDATA[
<p>Generate zero-overhead C++ exception handlers.</p>
]]>
</flag>

<flag name="accnoauto" 
 class="optimization" 
 compilers="mpicc, mpicxx,mpif90" 
 regexp="-acc\=noautopar\b">
<![CDATA[
<p>Disable loop autoparallelization within a acc parallel region.</p>
]]>
<example>-acc=noautopar</example>
</flag>

<flag name="accgpu" 
 class="optimization" 
 compilers="mpicc,mpicxx,mpif90" 
 regexp="-acc\=gpu\b">
<![CDATA[
<p>Enable OpenACC directives targeting NVIDIA GPUs</p>
]]>
<example>-acc=gpu</example>
</flag>

<flag name="accmulticore" 
 class="optimization" 
 compilers="mpicc, mpicxx,mpif90" 
 regexp="-acc\=multicore\b">
<![CDATA[
<p>Enable OpenACC directives targeting multicore CPUs.</p>
]]>
<example>-acc=multicore</example>
</flag>

<flag name="acc" 
 class="optimization" 
 compilers="mpicc,mpicxx,mpif90" 
 regexp="-acc\b">
<![CDATA[
<p>Enable OpenACC directives.</p>
]]>
<example>-acc</example>
</flag>

<flag name="Mautoinline" 
 class="optimization" 
 compilers="mpicc, mpicxx,mpif90" 
 regexp="-Mautoinline\b">
<![CDATA[
<p>Inline functions declared with the inline keyword.</p>
]]>
<example>-Mautoinline</example>
</flag>

<flag name="Mnoautoinline" 
 class="optimization" 
 compilers="mpicc, mpicxx,mpif90" 
 regexp="-Mnoautoinline\b">
<![CDATA[
<p>Disable inlining of functions declared with the inline keyword. &lt;Default&gt;</p>
]]>
<example>-Mnoautoinline</example>
</flag>


<flag name="Mcache_align" 
 class="optimization" 
 compilers="mpicc, mpicxx,mpif90" 
 regexp="-Mcache_align\b">
<![CDATA[
 <p>Align "unconstrained" data objects of size greater than or equal to 16
bytes on cache-line boundaries.  An "unconstrained" object is a variable or
array that is not a member of an aggregate structure or common block, is not
allocatable, and is not an automatic array.  On by default on 64-bit Linux systems.</p>
 ]]> 
<example>-Mcache_align</example>
</flag>

<flag name="Mdalign" 
  class="optimization" 
  compilers="mpicc, mpicxx,mpif90" 
  regexp="-Mdalign\b">
<![CDATA[
 <p>Align doubles on double alignment boundaries</p>
]]>
<example>-Mdalign</example>
</flag>

<flag name="Mnodalign" 
  class="optimization" 
  compilers="mpicc, mpicxx,mpif90" 
  regexp="-Mnodalign\b">
<![CDATA[
 <p>Do not align doubles on double alignment boundaries. &lt;Default&gt;</p>
]]>
<example>-Mnodalign</example>
</flag>

<flag name="Mbyteswapio" 
  class="portability" 
  compilers="mpif90" 
  regexp="-Mbyteswapio\b">
<![CDATA[
 <p>Swap byte-order for unformatted input/output.</p>
]]>
<example>-Mbyteswapio</example>
</flag>

<flag name="Mflushz" 
  class="optimization" 
  compilers="mpicc, mpicxx,mpif90" 
  regexp="-Mflushz\b">
<![CDATA[
 <p>Set SSE to flush-to-zero mode; if a floating-point underflow occurs, the value is set to zero.</p>
]]>
<example>-Mflushz</example>
</flag>

<flag name="Mframe" class="optimization" 
 compilers="mpicc, mpicxx,mpif90" 
 regexp="-Mframe\b">
<![CDATA[
 <p>Generate code to set up a stack frame. &lt;Default&gt;</p>
]]>
<example>-Mframe</example>
</flag>

<flag name="Mnoframe" class="optimization" 
 compilers="mpicc, mpicxx,mpif90" 
 regexp="-Mnoframe\b">
<![CDATA[
 <p>Eliminates operations that set up a true stack frame pointer for every function.  With this option enabled, you
cannot perform a traceback on the generated code and you cannot access local variables.</p>
]]>
<example>-Mnoframe</example>
</flag>

<flag name="Mfprelaxed_subopt" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Mfprelaxed=([^,\s]+),(\S+)\b" >
<include text="-Mfprelaxed=$1" />
<include text="-Mfprelaxed=$2" />
<display enable="0" />
SPEChpc flags file rule used to split an optimization flag containing sub-options into multiple flag descriptions.  
Please refer to the flag file rule of the various sub-options for the actual flag description. 
</flag>

<flag name="Mfprelaxed_rsqrt" class="optimization" 
      compilers="mpicc,mpicxx,mpif90" 
      regexp="-Mfprelaxed=rsqrt\b">
<![CDATA[
 <p>Instructs the compiler to use relaxed precision in the calculation of floating-point reciprocal square root (1/sqrt). Can result in 
improved performance at the expense of numerical accuracy.</p>
 ]]>
<example>-Mfprelaxed=rsqrt</example>
</flag>

<flag name="Mfprelaxed_sqrt" class="optimization" 
      compilers="mpicc, mpicxx,mpif90" 
      regexp="-Mfprelaxed=sqrt\b">
<![CDATA[
 <p>Instructs the compiler to use relaxed precision in the calculation of floating-point square root. Can result in 
improved performance at the expense of numerical accuracy.</p>
 ]]>
<example>-Mfprelaxed=sqrt</example>
</flag>

<flag name="Mfprelaxed_div" class="optimization" 
      compilers="mpicc, mpicxx,mpif90" 
      regexp="-Mfprelaxed=div\b">
<![CDATA[
 <p>Instructs the compiler to use relaxed precision in the calculation of floating-point division. Can result in improved performance at the expense of numerical accuracy.</p>
 ]]>
<example>-Mfprelaxed=div</example>
</flag>

<flag name="Mfprelaxed_intrinsic" class="optimization" 
      compilers="mpicc, mpicxx, mpif90" 
      regexp="-Mfprelaxed=intrinsic\b">
<![CDATA[
 <p>Instructs the compiler to use relaxed precision for intrinsics. Can result in improved performance at the expense of numerical accuracy.</p>
 ]]>
<example>-Mfprelaxed=div</example>
</flag>

<flag name="Mfprelaxed_order" class="optimization" 
      compilers="mpicc, mpicxx,mpif90" 
      regexp="-Mfprelaxed=order\b">
<![CDATA[
 <p>Instructs the compiler to allow floating-point expression reordering, including factoring. Can result in 
improved performance at the expense of numerical accuracy.</p>
 ]]>
<example>-Mfprelaxed=order</example>
</flag>

<flag name="Mfprelaxed" class="optimization" 
      compilers="mpicc, mpicxx,mpif90" 
      regexp="-Mfprelaxed\b">
<![CDATA[
 <p>Instructs the compiler to use relaxed precision in the calculation of some intrinsic functions.  Can result in 
improved performance at the expense of numerical accuracy.</p>
 ]]>
<example>-Mfprelaxed</example>
<include flag="Mfprelaxed_rsqrt" />
<include flag="Mfprelaxed_sqrt" />
<include flag="Mfprelaxed_div" />
<include flag="Mfprelaxed_order" />
</flag>

<flag name="Msignextend" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Msignextend\b">
<![CDATA[
 <p>Instructs the compiler to extend the sign bit that is set as a result of an object's conversion from one
 data type to an object of a larger signed data type.</p>
]]>
<example>-Msignextend</example>
</flag>

<flag name="Mnouniform" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Mnouniform\b">
<![CDATA[
 <p>The numerical method used when computing the residual iterations of a vectorized (SIMD) loop may be 
different than used in the vectorized loop.  Using this option may lead for fast but less numerically 
consistent results.
</p>
]]>
<example>-Mnouniform</example>
</flag>

<flag name="Mlre_assoc" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Mlre=assoc\b">
<![CDATA[
 <p>Allow expression re-association; specifying this sub-option can increase opportunities for loop-carried 
 redundancy elimination.</p>
]]>
<example>-Mlre=assoc</example>
<include flag="Mlre" />
</flag>

<flag name="Mlre_noassoc" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Mlre=noassoc\b">
<![CDATA[
 <p>Disable expression re-association.</p>
]]>
<example>-Mlre=noassoc</example>
<include flag="Mlre" />
</flag>

<flag name="Mlre" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Mlre\b">
<![CDATA[
 <p>Enables loop-carried redundancy elimination, an optimization that can reduce the number of arithmetic operations
 and memory references in loops.</p>
]]>
<example>-Mlre</example>
</flag>

<flag name="Mnolre" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Mnolre\b">
<![CDATA[
 <p>Disable loop-carried redundancy elimination. &lt;Default&gt;</p>
]]>
<example>-Mnolre</example>
</flag>

<flag name="Minfoaccel" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Minfo\=accel\b">
<![CDATA[
 <p>Print compiler feedback messages for acceleration.</p>
]]>
<example>-Minfo=accel</example>
</flag>

<flag name="Minfomp" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Minfo\=mp\b">
<![CDATA[
 <p>Print compiler feedback messages for OpenMP.</p>
]]>
<example>-Minfo=accel</example>
</flag>


<flag name="Minfo" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Minfo\b">
<![CDATA[
 <p>Print compiler feedback messages.</p>
]]>
<example>-Minfo</example>
</flag>

<flag name="Minline_subopt" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Minline=([^,\s]+),(\S+)\b">
<include text="-Minline=$1" />
<include text="-Minline=$2" />
<display enable="0" />
SPEChpc flags file rule used to split an optimization flag containing sub-options into multiple flag descriptions.  
Please refer to the flag file rule of the various sub-options for the actual flag description. 
</flag>

<flag name="Minline_lib" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Minline=lib:([\.\-\w]+)\b">
<![CDATA[
 <p>Instructs the inliner to inline the functions within the library <b>filename.ext</b>.</p>
]]>
<example>-Minline=lib:filename.ext</example>
</flag>

<flag name="Minline_except" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Minline=except:([\-\w,]+)\b" >
<![CDATA[
 <p>Instructs the inliner to inline all eligible functions except <b>$1</b>, a function in the source text.
 Multiple functions can be listed, comma-separated.</p>
]]>
<example>-Minline=except:func</example>
<ex_replacement>foo</ex_replacement>
</flag>

<flag name="Minline_name" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Minline=name:([\-\w,]+)\b" >
<![CDATA[
 <p>Instructs the inliner to inline function <b>func</b>.</p>
]]>
<example>-Minline=name:func</example>
</flag>

<flag name="Minline_reshape" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Minline=reshape\b">
<![CDATA[
 <p>Allows inlining in Fortran even when array shapes do not match.</p>
]]>
<example>-Minline=reshape</example>
</flag>

<flag name="Minline_size" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Minline=size:(\d+)\b">
<![CDATA[
 <p>Instructs the inliner to inline functions with <b>$1</b> or fewer statements where <b>$1</b> is a supplied constant value.</p>
]]>
<ex_replacement>N</ex_replacement>
<example>-Minline=size:n</example>
</flag>

<flag name="Minline_totalsize" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Minline=totalsize:(\d+)\b">
<![CDATA[
 <p>Limit inlining to total size of n.</p>
]]>
<ex_replacement>N</ex_replacement>
<example>-Minline=totalsize:n</example>
</flag>

<flag name="Minline_maxsize" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Minline=maxsize:(\d+)\b">
<![CDATA[
 <p>Inline only functions smaller than n.</p>
]]>
<ex_replacement>N</ex_replacement>
<example>-Minline=maxsize:n</example>
</flag>

<flag name="Minline_smallsize" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Minline=smallsize:(\d+)\b">
<![CDATA[
 <p>Always inline functions smaller than n.</p>
]]>
<ex_replacement>N</ex_replacement>
<example>-Minline=smallsize:n</example>
</flag>

<flag name="Minline_levels" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Minline=levels:(\d+)\b">
<![CDATA[
 <p>Instructs the inliner to perform <b>$1</b> levels of inlining where <b>$1</b> is a supplied constant value.  If no value is suppiled, then the default value of 2 is used.</p>
]]>
<ex_replacement>N</ex_replacement>
<example>-Minline=levels:4</example>
</flag>

<flag name="Minline" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Minline\b">
<![CDATA[
 <p>Instructs the inliner to perform 1 level of inlining.</p>
]]>
<example>-Minline</example>
</flag>

<flag name="Mstackarrays" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Mstack_arrays\b">
<![CDATA[
 <p>Place automatic arrays on the stack.</p>
]]>
<example>-Mstack_arrays</example>
</flag>

<flag name="Msafeptr_subopt" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Msafeptr=([^,\s]+),(\S+)\b">
<include text="-Msafeptr=$1" />
<include text="-Msafeptr=$2" />
<display enable="0" />
SPEChpc flags file rule used to split an optimization flag containing sub-options into multiple flag descriptions.  
Please refer to the flag file rule of the various sub-options for the actual flag description. 
</flag>

<flag name="Msafeptr_all" class="optimization"
 compilers="mpicc, mpicxx"
 regexp="-Msafeptr=all\b">
<![CDATA[
 <p>Assume all pointers and arrays are independent and safe for aggressive optimizations,
 and in particular that no pointers or arrays overlap of conflict with each other.</p>
]]>
<example>-Msafeptr=all</example>
<include flag="Msafeptr" />
</flag>

<flag name="Msafeptr_arg" class="optimization"
 compilers="mpicc, mpicxx"
 regexp="-Msafeptr=arg\b">
<![CDATA[
 <p>Instructs the compiler that arrays and pointers are treated with the same copyin and copyout
 semantics as Fortran dummy arguments.</p>
]]>
<example>-Msafeptr=arg</example>
<include flag="Msafeptr" />
</flag>

<flag name="Msafeptr_auto" class="optimization"
 compilers="mpicc, mpicxx"
 regexp="-Msafeptr=auto\b">
<![CDATA[
 <p>Instructs the compiler that local pointers and arrays do not overlap or
 conflict with each other and are independent.</p>
]]>
<example>-Msafeptr=auto</example>
<include flag="Msafeptr" />
</flag>

<flag name="Msafeptr_local" class="optimization"
 compilers="mpicc, mpicxx"
 regexp="-Msafeptr=local\b">
<![CDATA[
 <p>Instructs the compiler that local pointers and arrays do not overlap or
 conflict with each other and are independent.</p>
]]>
<example>-Msafeptr=local</example>
<include flag="Msafeptr" />
</flag>

<flag name="Msafeptr_static" class="optimization"
 compilers="mpicc, mpicxx"
 regexp="-Msafeptr=static\b">
<![CDATA[
 <p>Instructs the compiler that static pointers and arrays do not overlap or conflict
 with each other and are independent.</p>
]]>
<example>-Msafeptr=static</example>
<include flag="Msafeptr" />
</flag>

<flag name="Msafeptr_global" class="optimization"
 compilers="mpicc, mpicxx"
 regexp="-Msafeptr=global\b">
<![CDATA[
 <p>Instructs the compiler that global or external pointers and arrays do not overlap or 
 conflict with each other and are independent.</p>
]]>
<example>-Msafeptr=global</example>
<include flag="Msafeptr" />
</flag>

<flag name="Msafeptr" class="optimization"
 compilers="mpicc, mpicxx"
 regexp="-Msafeptr\b">
<![CDATA[
 <p>Instructs the C/C++ compiler to override data dependencies between pointers of a given storage class.</p>
]]>
<example>-Msafeptr</example>
</flag>

<flag name="Munroll_subopt" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Munroll=([^,\s]+),(\S+)\b">
<include text="-Munroll=$1" />
<include text="-Munroll=$2" />
<display enable="0" />
ACCEL flags file rule used to split an optimization flag containing sub-options into multiple flag descriptions.  
Please refer to the flag file rule of the various sub-options for the actual flag description. 
</flag>

<flag name="Munroll_c_n" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Munroll=c:(\d+)\b">
<![CDATA[
 <p>Instructs the compiler to completely unroll loops with a constant loop count of less than
 or equal to <b>$1</b> where <b>$1</b> is a supplied constant value.  If no constant value is given, then a default of 4 is used.  A value of 1 inhibits the complete unrolling of loops with constant loop counts.</p>
]]>
<ex_replacement>N</ex_replacement>
<example>-Munroll=c:1</example>
<include flag="Munroll" />
</flag>

<flag name="Munroll_n_n" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Munroll=n:(\d+)\b">
<![CDATA[
 <p>"-Munroll=n:n" instructs the compiler to unroll loops <b>$1</b> times where <b>$1</b> is a supplied constant value.  
If no constant value is given, then a default of 4 is used.</p>
]]>
<ex_replacement>N</ex_replacement>
<example>-Munroll=n:n</example>
<include flag="Munroll" />
</flag>

<flag name="Munroll_m_n" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Munroll=m:(\d+)\b">
<![CDATA[
 <p>"-Munroll=m:n" instructs the compiler to unroll loops with multiple blocks <b>$1</b> times where <b>$1</b> is a supplied constant value.  
If no constant value is given, then a default of 4 is used.</p>
]]>
<ex_replacement>N</ex_replacement>
<example>-Munroll=m:n</example>
<include flag="Munroll" />
</flag>

<flag name="Munroll_m" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Munroll=m\b">
<![CDATA[
 <p>Instructs the compiler to unroll loops with multiple blocks using the default value of 4 times</p>
]]>
<example>-Munroll=m</example>
<include flag="Munroll" />
</flag>

<flag name="Munroll" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Munroll\b">
<![CDATA[
 <p>Invokes the loop unroller.</p>
]]>
<example>-Munroll</example>
</flag>

<flag name="Mnounroll" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Mnounroll\b">
<![CDATA[
 <p>Disable loop unrolling. &lt;Default&gt;</p>
]]>
<example>-Mnounroll</example>
</flag>

<flag name="Mnodepchk" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="\-Mnodepchk\b">
<![CDATA[
 <p>Don't check dependence relations for vector or parallel code.</p>
]]>
</flag>

<flag name="Mschar" class="optimization"
 compilers="mpicc, mpicxx"
 regexp="-Mschar\b">
<![CDATA[
 <p>Treat plain char as signed.</p>
]]>
<example>-Mschar</example>
</flag>

<flag name="Muchar" class="optimization"
 compilers="mpicc, mpicxx"
 regexp="-Muchar\b">
<![CDATA[
 <p>Treat plain char as unsigned.</p>
]]>
<example>-Muchar</example>
</flag>

<flag name="Mnosmart" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Mnosmart\b">
<![CDATA[
 <p>Disable an optional post-pass instruction scheduling. &lt;Default&gt;</p>
]]>
<example>-Mnosmart</example>
</flag>

<flag name="Mvect_subopt" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Mvect=([^,\s]+),([\:\S]+)\b">
<include text="-Mvect=$1" />
<include text="-Mvect=$2" />
<display enable="0" />
SPEChpc flags file rule used to split an optimization flag containing sub-options into multiple flag descriptions.  
Please refer to the flag file rule of the various sub-options for the actual flag description. 
</flag>

<flag name="Mnovect" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Mnovect\b">
<![CDATA[
 <p>Disable automatic vector pipelining. &lt;Default&gt;</p>
]]>
<example>-Mnovect</example>
</flag>

<flag name="Mvect_altcode" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Mvect=altcode\b">
<![CDATA[
 <p>Instructs the vectorizer to generate alternate code for vectorized loops when appropriate.  For each
 vectorized loop the compiler decides whether to generate altcode and what type or types to generate, which may
 be any or all of:</p>
<ul>
<li>Altcode without iteration peeling</li>
<li>Altcode with non-temporal stores and other data cache optimizations</li>
<li>Altcode base on array alignments calculated dynamically at runtime.</li>
</ul>
<p>The compiler also determines suitable loop count and array alignment conditions for executing the altcode.</p>
]]>
<example>-Mvect=altcode</example>
</flag>

<flag name="Mvect_noaltcode" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Mvect=noaltcode\b">
<![CDATA[
 <p>Disables alternate code generation for vectorized loops.</p>
]]>
<example>-Mvect=noaltcode</example>
</flag>

<flag name="Mvect_assoc" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Mvect=altcode\b">
<![CDATA[
 <p>Instructs the vectorizer to enable certain associativity conversions that can change the results of a computations
 due to roundoff error.  A typical optimization is to change an arithmetic operation to an arithmetic opteration that is 
 mathmatically correct, but can be computationally different, due to round-off error.</p>
]]>
<example>-Mvect=assoc</example>
</flag>

<flag name="Mvect_noassoc" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Mvect=noassoc\b">
<![CDATA[
 <p>Instructs the vectorizer to disable associativity conversions.</p>
]]>
<example>-Mvect=noassoc</example>
</flag>

<flag name="Mvect_cachesize_n" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="\-Mvect=cachesize:(\d+)\b">
<![CDATA[
 <p>Instructs the vectorizer, when performing cache tiling optimizations, to assume a cache size of <b>$1</b>.
 The default size is processor dependent.</p>
]]>
<ex_replacement>N</ex_replacement>
<example>-Mvect=cachesize:n</example>
</flag>

<flag name="Mvect_fuse" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Mvect=fuse\b">
<![CDATA[
 <p>Instructs the vectorizer to enable loop fusion.</p>
]]>
<example>-Mvect=fuse</example>
<include flag="Mvect" />
</flag>

<flag name="Mvect_nogather" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Mvect=nogather\b">
<![CDATA[
 <p>Instructs the vectorizer to disable vectorization of indirect array references.</p>
]]>
<example>-Mvect=nogather</example>
<include flag="Mvect" />
</flag>

<flag name="Mvect_idiom" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Mvect=idiom\b">
<![CDATA[
 <p>Instructs the vectorizer to enable idiom recognition.</p>
]]>
<example>-Mvect=idiom</example>
</flag>

<flag name="Mvect_noidiom" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Mvect=noidiom\b">
<![CDATA[
 <p>Instructs the vectorizer to disable idiom recognition.</p>
]]>
<example>-Mvect=noidiom</example>
</flag>

<flag name="Mvect_nosizelimit" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Mvect=nosizelimit\b">
<![CDATA[
 <p>Generate vector loops for all loops where possible regardless of the number of
 statements in the loop.  This overrides a heuristic in the vectorizer that ordinarily
 prevents vectorization of loops with a number of statements that exceed a certain threshold.</p>
]]>
<example>-Mvect=nosizelimit</example>
<include flag="Mvect" />
</flag>

<flag name="Mvect_partial" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Mvect=partial\b">
<![CDATA[
 <p>Instructs the vectorizer to generate partial vectorization.</p>
]]>
<example>-Mvect=partial</example>
<include flag="Mvect" />
</flag>

<flag name="Mvect_prefetch" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Mvect=prefetch\b">
<![CDATA[
 <p>Instructs the vectorizer to generate prefetch instructions.</p>
]]>
<example>-Mvect=prefetch</example>
<include flag="Mvect" />
</flag>

<flag name="Mvect_short" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Mvect=short\b">
<![CDATA[
 <p>Enables generation of packed SSE instructions for short
vector operations that arise from scalar code outside of loops or within
the body of a loop iteration.
 </p>
]]>
<include flag="Mvect" />
<example>-Mvect=short</example>
</flag>

<flag name="Mvect_sse" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Mvect=sse\b">
<![CDATA[
 <p>Instructs the vectorizer to search for vectorizable loops and, where possible, make use of
 SSE, SSE2, and prefetch instructions.</p>
]]>
<include flag="Mvect" />
<example>-Mvect=sse</example>
</flag>

<flag name="Mvect_nosse" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Mvect=nosse\b">
<![CDATA[
 <p>Instructs the driver to disable the -Mvect=sse option which is part of the "-fast" option.</p>
]]>
<include flag="Mvect_sse" />
<include flag="fast" />
<example>-Mvect=nosse</example>
</flag>

<flag name="Mvect" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Mvect\b">
<![CDATA[
 <p>Enable automatic vector pipelining.</p>
]]>
<include flag="Mvect_assoc" />
<include flag="Mvect_altcode" />
<include text="Mvect=cachesize:262144" />
<example>-Mvect</example>
</flag>

<flag name="Mnofptrap" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Mnofptrap\b">
<![CDATA[
 <p>Disables -Ktrap=fp.</p>
]]>
<example>-Mnofptrap</example>
<include flag="Ktrap" />
</flag>

<flag name="Ktrap" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Ktrap\w*\b">
<![CDATA[
 <p>-Ktrap is only processed by the compilers when compiling main functions' programs. The options inv, denorm, divz, ovf, unf, and inexact correspond to the processor's exception mask bits invalid operation, denormalized operand, divide-by-zero, overflow, underflow, and precision, respectively. Normally, the processor's exception mask bits are on (floating-point exceptions are masked the processor recovers from the exceptions and continues). If a floating-point exception occurs and its corresponding mask bit is off (or  unmasked ), execution terminates with an arithmetic exception (C's SIGFPE signal). -Ktrap=fp is equivalent to -Ktrap=inv,divz,ovf.
</p>
]]>
<example>-Ktrap=fp</example>
</flag>

<flag name="mp_gpu" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-mp\=gpu\b">
<![CDATA[
 <p>Enable OpenMP directives targeting an NVIDIA GPU.</p>
]]>
<example>-mp=gpu</example>
<include flag="mp" />
</flag>

<flag name="mp" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-mp\b">
<![CDATA[
 <p>Use the -mp option to instruct the compiler to interpret user-inserted OpenMP shared-memory parallel programming directives and generate an executable file which will utilize multiple processors in a shared-memory parallel system. 

When used strictly as a linker flag, the PGI OpenMP runtime will be linked and users can use the environment variables MP_BIND and MP_BLIST to bind a serial program to a CPU.
</p>
]]>
<example>-mp</example>
</flag>



<flag name="mcmodel_medium" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-mcmodel=medium\b">
<![CDATA[
 <p>(For use only on 64-bit Linux targets) Generate code for the medium memory model in the linux86-64 execution environment. The default small memory model of the linux86-64 environment limits the combined area for a user's object or executable to 1GB, with the Linux kernel managing usage of the second 1GB of address for system routines, shared libraries, stacks, etc. Programs are started at a fixed address, and the program can use a single instruction to make most memory references. The medium memory model allows for larger than 2GB data areas, or .bss sections. Program units compiled using either -mcmodel=medium or -fpic require additional instructions to reference memory. The effect on performance is a function of the data-use of the application. The -mcmodel=medium switch must be used at both compile time and link time to create 64-bit executables. Program units compiled for the default small memory model can be linked into medium memory model executables as long as they are compiled -fpic, or position-independent.</p>
]]>
<example>-mcmodel=medium</example>
<include flag="Mlarge_arrays" />
</flag>


<flag name="Mlarge_arrays" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Mlarge_arrays\b">
<![CDATA[<p>Enable support for 64-bit indexing and single static data objects larger than 2GB in size. This option is default in the presence of -mcmodel=medium. Can be used separately together with the default small memory model for certain 64-bit applications that manage their own memory space.</p>
]]>
<example>-Mlarge_arrays</example>
</flag>

<flag name="alias_ansi" class="optimization"
 compilers="mpicc, mpicxx"
 regexp="\-alias\=ansi\b">
<![CDATA[
<p>Enable optimizations using ANSI C type-based pointer disambiguation.</p>
]]>
</flag>

<flag name="Odefault" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-O\b">
<![CDATA[
 <p>Set the optimization level to -O</p>
]]>
<include flag="O2" />
<example>-O</example>
</flag>

<flag name="O0" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-O0\b">
<![CDATA[
 <p>A basic block is generated for each C statement.  No scheduling is done
between statements.  No global optimizations are performed.</p>
]]>
<example>-O0</example>
</flag>

<flag name="O1" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-O1\b">
<![CDATA[
 <p>Level-one optimization specifies local optimization (-O1). The compiler performs scheduling of basic blocks as well as register allocation. This optimization level is a good choice when the code is very irregular; that is it contains many short statements containing IF statements and the program does not contain loops (DO or DO WHILE statements). For certain types of code, this optimization level may perform better than level-two (-O2) although this case rarely occurs.</p>
<p>The PGI compilers perform many different types of local optimizations, including but not limited to:</p>
<ul>
<li>Algebraic identity removal</li>
<li>Constant folding</li>
<li>Common subexpression elimination</li>
<li>Local register optimization</li>
<li>Peephole optimizations</li>
<li>Redundant load and store elimination</li>
<li>Strength reductions</li>
</ul>
Note that this is the default optimiation level when no optimization flags are specified on the compilation command line.
]]>
<example>-O1</example>
</flag>

<flag name="O2" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-O2\b">
<![CDATA[
 <p>
Level-two optimization (-O2 or -O) specifies global optimization. The -fast option generally will specify global optimization; however, the -fast switch will vary from release to release depending on a reasonable selection of switches for any one particular release. The -O or -O2 level performs all level-one local optimizations as well as global optimizations. Control flow analysis is applied and global registers are allocated for all functions and subroutines. Loop regions are given special consideration. This optimization level is a good choice when the program contains loops, the loops are short, and the structure of the code is regular.</p>
<p>The PGI compilers perform many different types of global optimizations, including but not limited to:</p>
<ul>
<li>Branch to branch elimination</li>
<li>Constant propagation</li>
<li>Copy propagation</li>
<li>Dead store elimination</li>
<li>Global register allocation</li>
<li>Invariant code motion</li>
<li>Induction variable elimination</li>
</ul>
]]>
<include flag="O1" />
<example>-O2</example>
</flag>

<flag name="O3" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-O3\b">
<![CDATA[
 <p>All level 1 and 2 optimizations are performed.
In addition, this level enables more aggressive code hoisting and scalar replacement optimizations that may or may not be profitable.</p>
]]>
<include flag="O2" />
<example>-O3</example>
</flag>

<flag name="O4" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-O4\b">
<![CDATA[
 <p>Performs all level 1, 2, and 3 optimizations and enables hoisting of guarded invariant floating point expressions.</p>
]]>
<include flag="O3" />
<example>-O4</example>
</flag>

<flag name="static" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-static\b">
<![CDATA[
<p>Link with static libraries.</p>
]]>
</flag>

<flag name="staticnvidia" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-static-nvidia\b">
<![CDATA[
<p>Staticily link with the NVIDIA runtime libraries.  System libraries may still be dynamically linked.</p>
]]>
</flag>

<flag name="Bdynamic" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-Bdynamic\b">
<![CDATA[
<p>Link with dynamic libraries.</p>
]]>
</flag>

<flag name="Version" class="optimization"
 compilers="mpicc, mpicxx, mpif90"
 regexp="-V\b">
<![CDATA[
<p>Print the compiler version.</p>
]]>
</flag>

<flag name="fortranlibs" class="other"
 compilers="mpicc, mpicxx"
 regexp="-fortranlibs\b">
<![CDATA[
Include the NVIDIA Fortran runtime libraries when linking.
]]>
</flag>

</flagsdescription>
