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

<!-- This file defines flags for use with the AMD AOMP Linux Compilers -->
<flagsdescription>
<filename>amd2021_flags</filename>
<title>AMD Compilers.  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: AMD Fortran/C/C++</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 AOMP C++ compiler (clang++).</p>
 ]]>
<example>mpic++</example>
</flag>

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

<flag name='mpif90' class='compiler' regexp="mpif90\b" >
<![CDATA[
 <p>The OpenMPI Fortran driver configured for use with the AOMP Fortran compiler (flang).</p>
 ]]>
<example>mpif90</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="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). 
]]>
<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.
]]>
<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="fast-math" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-ffast-math\b">
<![CDATA[
 <p>All level 1 and 2 and 3 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="O3" />
<example>-O3</example>
</flag>

<flag name="flto" class="optimization"
 compilers="mpicc, mpicxx,mpif90"
 regexp="-flto\b">
<![CDATA[
<p>Generate output files in LLVM formats suitable for link time optimization.</p>
]]>
<include flag="O3" />
<example>-O3</example>
</flag>

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

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

<flag name="DSPEC_OPENMP_TARGET" class="optimization"
 compilers="mpicc, mpicxx, mpif90"
 regexp="-DSPEC_OPENMP_TARGET\b">
<![CDATA[
<p>Enable OPENMP Target Offload programming model for hpc2021.</p>
]]>
</flag>

<flag name="DSPEC_USE_MPIFH" class="optimization"
 compilers="mpicc, mpicxx, mpif90"
 regexp="-DSPEC_USE_MPIFH\b">
<![CDATA[
<p>Enable using textual F90 include instead of modules for MPI in hpc2021.</p>
]]>
</flag>

<flag name="targets" class="optimization"
 compilers="mpicc, mpicxx, mpif90"
 regexp="-targets=(\S+)(?=\s|$)\b">
<![CDATA[
<p>Select target to compile for.</p>
]]>
<example>-targets=amdgcn-amd-amdhsa</example>
</flag>

<flag name="XopenmpTarget" class="optimization"
 compilers="mpicc, mpicxx, mpif90"
 regexp="-Xopenmp-target=(\S+)(?=\s|$)\b">
<![CDATA[
<p>Select the openmp target to compile for.</p>
]]>
<example>-Xopenmp-target=amdgcn-amd-amdhsa</example>
</flag>

<flag name="March" class="optimization"
 compilers="mpicc, mpicxx, mpif90"
 regexp="-march=(\S+)(?=\s|$)\b">
<![CDATA[
<p>Select the specific target architecture to compile for.</p>
]]>
<example>-march=gfx900</example>
</flag>

<flag name="Mcpu" class="optimization"
 compilers="mpicc, mpicxx, mpif90"
 regexp="-mcpu=(\S+)(?=\s|$)\b">
<![CDATA[
<p>Select the specific target architecture to compile for.</p>
]]>
<example>-mcpu=x86</example>
</flag>


</flagsdescription>
