DFTI_THREAD_LIMIT
In some situations you may need to limit the number of threads that the
, it might be important that the thread calling these functions does not oversubscribe computing resources (CPU cores). Similarly, a known limit of the maximum number of threads to be used in computations might help the
DftiComputeForward
and
DftiComputeBackward
functions use. For example, if more than one thread calls Intel® oneAPI Math Kernel Library
DftiCommitDescriptor
function to select a more optimal computation method.
Set the parameter
DFTI_THREAD_LIMIT
as follows:
- To a positive number, to specify the maximum number of threads to be used by the compute functions.
- To zero (the default value), to use the maximum number of threads permitted inFFT functions. See "Techniques to Set the Number of Threads" in theIntel® oneAPI Math Kernel Libraryfor more information.Developer GuideIntel® oneAPI Math Kernel Library
On an attempt to set a negative value, the
DftiSetValue
function returns an error and does not update the descriptor.
The value of the
DFTI_THREAD_LIMIT
configuration parameter returned by the
DftiGetValue
function is defined as follows:
- 1 ifruns in the sequential modeIntel® oneAPI Math Kernel Library
- Depends of the commit status of the descriptor ifruns in a threaded mode:Intel® oneAPI Math Kernel LibraryCommit StatusValueNot committedThe value ofDFTI_THREAD_LIMITset in a previous call to theDftiSetValuefunction or the default valueCommittedThe upper limit on the number of threads used by theDftiComputeForwardandDftiComputeBackwardfunctions
To better understand the use of the
directory:
DFTI_THREAD_LIMIT
configuration parameter, see this example in your Intel® oneAPI Math Kernel Library
./examples/dftc/source/config_thread_limit.c