Developer Reference

  • 0.10
  • 10/21/2020
  • Public Content
Contents

mkl_domain_set_num_threads

Specifies the number of OpenMP* threads for a particular function domain.

Syntax

int
mkl_domain_set_num_threads
(
int
nt
,
int
domain
);
Include Files
  • mkl.h
Input Parameters
Name
Type
Description
nt
int
nt
> 0 - The number of threads suggested by the user.
nt
= 0 - The default number of threads for the OpenMP run-time library.
nt
< 0 - Invalid value, which is ignored.
domain
int
The named constant that defines the targeted domain.
Description
This function specifies how many OpenMP threads a particular function domain of
Intel® oneAPI Math Kernel Library
should use. If this number is not set (default) or if it is set to zero in a call to this function,
Intel® oneAPI Math Kernel Library
uses the default number of threads for the OpenMP run-time library. The number of threads specified applies to the specified function domain on all execution threads except the threads where the number of threads is set withmkl_set_num_threads_local. For a list of supported values of the
domain
argument, see Table "Intel MKL Function Domains".
The number of threads specified is only a hint, and
Intel® oneAPI Math Kernel Library
may actually use a smaller number.
This function takes precedence over the
MKL_DOMAIN_NUM_THREADS
environment variable.
Return Values
Name
Type
Description
ierr
int
1 - Indicates no error, execution is successful.
0 - Indicates a failure, possibly because of invalid input parameters.

Example

#include "mkl.h" … mkl_domain_set_num_threads(4, MKL_DOMAIN_BLAS); my_compute_using_mkl_blas(); // Intel MKL BLAS functions use up to 4 threads my_compute_using_mkl_dft(); // Intel MKL FFT functions use the default number of threads

Product and Performance Information

1

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