Create a gist now

Instantly share code, notes, and snippets.

@Atlas7 /compile-target.md Secret
Last active Aug 22, 2017

What would you like to do?
Intel Colfax Cluster - Targeting a Specific Instruction Set / Intel Processor Architecture

Intel Colfax Cluster - Notes - Index Page


Intro

The standard way to compile a C++ source code (hello.cc) into a binary (hello) with the Intel C++ Compiler looks like this:

icpc -o hello hello.cc

To make the compiled binary a bit more optimized to run on an Intel processor specific architecture, it is recommended to add a flat to indicate the target specfic instruction set. Concretely:

If binary is targeted to run on a bootable version of Xeon Phi (Host) Processor, we add the -xMIC-AVX512 in the command:

icpc -xMIC-AVX512 -o hello hello.cc

Note:

  • -xMIC-AVX512 is for the bootable version of Intel Xeon Phi processors
  • -xCORE-AVX512 is for Intel Xeon scalable processors (formerly Skylake)

See this Intel Doc for the full list of compiler option. Page 5 shows all the Recommended Processor-Specific Optimization Options.

Here is a snapshot borrowed from a Colfax Research Slide for ease of quick references:

intel-instruction-set.png

A Note

In some of my earlier articles when I didn't know about the recommended processor specific optimization options, it is very possible I might have omitted the -xMIC-AVX512 flag when compiling a binary to run on a Xeon Phi processor. I should have, in hindsight, for further optimization.


Intel Colfax Cluster - Notes - Index Page

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment