Visible to Intel only — GUID: GUID-D808F69D-5741-4DF6-950E-5B30A32D9B44
Visible to Intel only — GUID: GUID-D808F69D-5741-4DF6-950E-5B30A32D9B44
mkl_domain_set_num_threads
Specifies the number of OpenMP* threads for a particular function domain.
int mkl_domain_set_num_threads (int nt, int domain);
- mkl.h
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. |
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.
Name |
Type |
Description |
---|---|---|
ierr |
int |
1 - Indicates no error, execution is successful. 0 - Indicates a failure, possibly because of invalid input parameters. |
#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