Developer Guide

  • 2021.1
  • 12/04/2020
  • Public Content

Improving Performance with Threading

is extensively parallelized. SeeOpenMP* Threaded Functions and Problems and Functions Threaded with Intel® Threading Building Blocks for lists of threaded functions and problems that can be threaded.
Intel® oneAPI Math Kernel Library
, which means that all
Intel® oneAPI Math Kernel Library
functions (except the LAPACK deprecated routine
work correctly during simultaneous execution by multiple threads. In particular, any chunk of threaded
Intel® oneAPI Math Kernel Library
code provides access for multiple threads to the same shared data, while permitting only one thread at any given time to access a shared piece of data. Therefore, you can call
Intel® oneAPI Math Kernel Library
from multiple threads and not worry about the function instances interfering with each other.
If you are using OpenMP* threading technology,
you can use the environment variable
to specify the number of threads or the equivalent OpenMP run-time function calls.
Intel® oneAPI Math Kernel Library
also offers variables that are independent of OpenMP, such as
, and equivalent
Intel® oneAPI Math Kernel Library
functions for thread management. The
Intel® oneAPI Math Kernel Library
variables are always inspected first, then the OpenMP variables are examined, and if neither is used, the OpenMP software chooses the default number of threads.
By default,
Intel® oneAPI Math Kernel Library
uses the number of
threads equal to the number of physical cores on the system.
If you are using the Intel TBB threading technology, the OpenMP threading controls, such as the
environment variable or
function, have no effect. Use the Intel TBB application programming interface to control the number of threads.
To achieve higher performance, set the number of threads to the number of processors or physical cores, as summarized in Techniques to Set the Number of Threads.
Optimization Notice
Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.
Notice revision #20110804
This notice covers the following instruction sets: SSE2, SSE4.2, AVX2, AVX-512.

Product and Performance Information


Performance varies by use, configuration and other factors. Learn more at