Developer Guide for Intel® oneAPI Math Kernel Library for Linux*
Improving Performance for Small Size Problems
The overhead of calling an Intel® oneAPI Math Kernel Library (oneMKL) function for small problem sizes can be significant when the function has a large number of parameters or internally checks parameter errors. To reduce the performance overhead for these small size problems, the Intel® oneMKL direct call feature works in conjunction with the compiler to preprocess the calling parameters to supported Intel® oneMKL functions and directly call or inline special optimized small-matrix kernels that bypass error checking. For a list of functions supporting direct call, see Limitations of the Direct Call .
For ?gemm calls, you can enable JIT direct call to use just-in-time generated kernels for eligible matrix sizes. Calls that are not eligible for a JIT-generated kernel use the standard direct call path.
To activate the feature, do the following:
Compile your C or Fortran code with the preprocessor macro depending on whether a threaded or sequential mode of Intel® oneMKL is required by supplying the compiler option as explained below:
Intel® oneMKL Mode
Direct Call Type
Macro
Compiler Option
Threaded
Standard
MKL_DIRECT_CALL
-DMKL_DIRECT_CALL
Threaded
JIT
MKL_DIRECT_CALL_JIT
-DMKL_DIRECT_CALL_JIT
Sequential
Standard
MKL_DIRECT_CALL_SEQ
-DMKL_DIRECT_CALL_SEQ
Sequential
JIT
MKL_DIRECT_CALL_SEQ_JIT
-DMKL_DIRECT_CALL_SEQ_JIT
For Fortran applications: *
Enable preprocessor by using the -fpp option for Intel® Fortran Compiler.
Include the Intel® oneMKL Fortran include file mkl_direct_call.fi .
Intel® oneMKL skips error checking and intermediate function calls if the problem size is small enough (for example: a call to a function that supports direct call, such as dgemm , with matrix ranks smaller than 50).
Product and Performance Information |
|---|
Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex . Notice revision #20201201 |