System information
Intel® Xeon Phi™ Coprocessor DEVELOPER’S QUICK START GUIDE
16
• Some sample offload code using the explicit memory copy model can be found in:
o C++:
/opt/intel/composerxe/Samples/en_US/C++/mic_samples/intro_sampleC/
o Fortran: /opt/intel/composerxe/Samples/en_US/Fortran/mic_samples/
o Intel® MKL: /opt/intel/composerxe/mkl/examples/mic*
o For examples of Intel® MKL automated offload:
/opt/intel/composerxe/mkl/examples/mic_ao/blasc
and …/mic_ao/blasf
o The rest of the samples demonstrate use of MKL via compiler-assisted offload
(/opt/intel/composerxe/mkl/examples/mic_offload).
• Some sample offload code using the implicit memory copy model can be found in:
o C:
/opt/intel/composerxe/Samples/en_US/C++/mic_samples/shrd_sampleC
and …/LEO_tutorial
o C++:
/opt/intel/composerxe/Samples/en_US/C++/mic_samples/shrd_sampleCP
P
Build-Related Information
• The offload compiler produces “fat” binaries and .so files that contain code for both host and the
Intel® Xeon Phi™ Coprocessor.
• The offload compiler produces code that examines the runtime execution environment for the
presence of an Intel® Xeon Phi™ Coprocessor. If one is not present, it falls back to executing the
“offloaded” code on the host. In other words, the offload compiler will create both host and Intel® MIC
Architecture versions of all code marked for offload.
• A number of workarounds and hints can be found in Release-notes-*-2013-l-en.pdf.
Compiler Switches and Makefiles
When building applications that offload some of their code to the Intel® Xeon Phi™ Coprocessor, it is possible to
cause the offloaded code to be built with different compiler options from the host code. The method of
passing these options to the compiler is documented in the compiler documentation under the “Compiler
Reference/Compiler Options/Compiler Option Categories and Descriptions” section. Look for the –offload-
option compiler switch. In that same section, also look up the –offload-attribute-target compiler
switch, which provides an alternative to editing your source files in some situations (applies to the pragma-
based offload methods). Finally, -no-offload provides a way to make the compiler ignore the
_Cilk_offload and #pragma_offload constructs (which cause it by default to build a heterogeneous
binary).
Debugging During Runtime
To debug offload activity, the following environment variables are available:
To learn whether offload portions of the program are running on the host or coprocessor
For csh – setenv H_TRACE 1
For sh – export H_TRACE=1
For more complete debug information