Developer Reference for Intel® oneAPI Math Kernel Library for C
mkl_domain_set_num_threads
Specifies the number of OpenMP* threads for a particular function domain.
Syntax
intmkl_domain_set_num_threads ( intnt , intdomain );
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® oneMKL should use. If this number is not set (default) or if it is set to zero in a call to this function, Intel® oneMKL 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 with mkl_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® oneMKL may actually use a smaller number.
Return Values
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