3 <strong>Intel</strong>® M<strong>at</strong>h Kernel Library User’s GuideInterface Layer. The layer essentially provides m<strong>at</strong>ching between the compiled code of yourapplic<strong>at</strong>ion <strong>and</strong> the threading <strong>and</strong>/or comput<strong>at</strong>ional parts of the library. This layer mayallow for m<strong>at</strong>ching like these:• Provides LP64 interface to <strong>Intel</strong> MKL ILP64 software(see Support for ILP64 Programming for details)• Provides means to deal with the way different compilers return function values• For those software vendors th<strong>at</strong> use Cray-style names, provides mapping ofsingle-precision names to double-precision ones in applic<strong>at</strong>ions th<strong>at</strong> employ ILP64.Threading Layer. This layer provides a way for threaded <strong>Intel</strong> MKL to share supportedcompiler threading. The layer also provides for a sequential version of the library. Wh<strong>at</strong>was internal to the library previously, now is essentially exposed in the threading layer bybeing compiled for different environments (threaded or sequential) <strong>and</strong> compilers (<strong>Intel</strong>,gnu, <strong>and</strong> so on).<strong>Comput<strong>at</strong>ional</strong> Layer. It is the heart of <strong>Intel</strong> MKL <strong>and</strong> has only one variant for anyprocessor/oper<strong>at</strong>ing system family, such as 32-bit <strong>Intel</strong>® processors on a 32-bit oper<strong>at</strong>ingsystem. The comput<strong>at</strong>ional layer can accommod<strong>at</strong>e multiple architectures throughidentific<strong>at</strong>ion of the architecture or architectural fe<strong>at</strong>ure <strong>and</strong> choose the appropri<strong>at</strong>e binarycode <strong>at</strong> execution. <strong>Intel</strong> MKL may be thought of as the large comput<strong>at</strong>ional layer th<strong>at</strong> isunaffected by different comput<strong>at</strong>ional environments. Then, as it has no RTL requirements,RTLs refer not to the comput<strong>at</strong>ional layer but to one of the layers above it, th<strong>at</strong> is, theinterface layer or the threading layer. The most likely case is m<strong>at</strong>ching the threading layerwith the RTL layer.Compiler Support RTL Layer. This layer has run-time library support functions. For example,libguide <strong>and</strong> libiomp are RTLs providing threading support for the OpenMP* threadingin <strong>Intel</strong> MKL.See also the “Linking Examples” section in chapter 5.Sequential Version of the LibraryStarting with release 9.1, the <strong>Intel</strong> MKL package provides support for sequential, th<strong>at</strong> is,non-threaded, version of the library. It requires no Compiler Support RTL layer, th<strong>at</strong> is, noLegacy OpenMP* or Comp<strong>at</strong>ibility OpenMP* run-time libraries, <strong>and</strong> does not respond to theenvironment variable OMP_NUM_THREADS (see the Using <strong>Intel</strong>® MKL Parallelism section inchapter 6 for details). This version of <strong>Intel</strong> MKL runs unthreaded code. However, it isthread-safe, which means th<strong>at</strong> you can use it in a parallel region from your own OpenMPcode. You should use sequential version only if you have a particular reason not to use <strong>Intel</strong>MKL threading. The sequential version (layer) may be helpful when using <strong>Intel</strong> MKL withprograms threaded with non-<strong>Intel</strong> compilers or in other situ<strong>at</strong>ions where you may, forvarious reasons, need a non-threaded version of the library. For more inform<strong>at</strong>ion, seesection Avoiding Conflicts in the Execution Environment in chapter 6.3-4
<strong>Intel</strong>® M<strong>at</strong>h Kernel Library Structure 3To obtain sequential version of <strong>Intel</strong> MKL, in the Threading layer, choose the*sequential.* library to link (see Directory Structure in Detail).Note th<strong>at</strong> the sequential library depends on the POSIX threads library (pthread), which isused to make <strong>Intel</strong> MKL software thread-safe <strong>and</strong> should be included in the link line (seeLinking Examples in chapter 5).Support for ILP64 ProgrammingThe terms "LP64" <strong>and</strong> "ILP64" are used for certain historical reasons <strong>and</strong> due to theprogramming models philosophy described here:http ://www .unix.org/version2/wh<strong>at</strong>snew/lp64_wp.html .<strong>Intel</strong> MKL ILP64 libraries do not completely follow the programming models philosophy.However, the general idea is the same: use 64-bit integer type for indexing huge arrays,th<strong>at</strong> is, arrays with more than 2 31 -1 elements.It’s up to you to choose which interface to use. You should definitely choose LP64 interfacefor comp<strong>at</strong>ibility with the previous <strong>Intel</strong> MKL versions, as "LP64" is just a new name for theonly interface th<strong>at</strong> the <strong>Intel</strong> MKL versions lower than 9.1 provided. You should definitelychoose the ILP64 interface if your applic<strong>at</strong>ion uses <strong>Intel</strong> MKL for calcul<strong>at</strong>ions with huged<strong>at</strong>a arrays (of more than 2 31 -1 elements) or the library may be used so in future.The LP64 <strong>and</strong> ILP64 interfaces are supported in the Interface layer. Once the appropri<strong>at</strong>elibrary in the Interface layer is selected (see Directory Structure in Detail), all librariesbelow the Interface layer are compiled using the chosen interface.As the differences between the ILP64 <strong>and</strong> LP64 interfaces are out of scope of the <strong>Intel</strong> MKLReference Manual, you are encouraged to browse the include files, examples, <strong>and</strong> tests forthe ILP64 interface details. To do this, see the following directories, respectively:/include/examples/testsThis section shows• How the ILP64 concept is implemented specifically for <strong>Intel</strong> MKL• How to compile your code for the ILP64 interface• How to code for the ILP64 interface• How to browse the <strong>Intel</strong> MKL include files for the ILP64 interfaceThis section also explains limit<strong>at</strong>ions of the ILP64 support.3-5