Developer Guide
Developer Guide for Intel® oneAPI Math Kernel Library Linux*
                    
                        ID
                        766690
                    
                
                
                    Date
                    6/30/2025
                
                
                    Public
                
            
                        
                        
                            
                            
                                Getting Help and Support
                            
                        
                            
                            
                                What's New
                            
                        
                            
                            
                                Notational Conventions
                            
                        
                            
                            
                                Related Information
                            
                        
                            
                                Getting Started
                            
                            
                        
                            
                                Structure of the Intel® oneAPI Math Kernel Library
                            
                            
                        
                            
                                Linking Your Application with the Intel® oneAPI Math Kernel Library
                            
                            
                        
                            
                                Managing Performance and Memory
                            
                            
                        
                            
                                Language-Specific Usage Options
                            
                            
                        
                            
                                Obtaining Numerically Reproducible Results
                            
                            
                        
                            
                                Coding Tips
                            
                            
                        
                            
                                Managing Output
                            
                            
                        
                            
                                Working with the Intel® Math Kernel Library Cluster Edition Software
                            
                            
                        
                            
                                Managing Behavior of the Intel® oneAPI Math Kernel Library with Environment Variables
                            
                            
                        
                            
                                Configuring Your Integrated Development Environment to Link with Intel® oneAPI Math Kernel Library
                            
                            
                        
                            
                                Intel® Math Kernel Library Benchmarks
                            
                            
                        
                            
                                Appendix A: Intel® oneAPI Math Kernel Library Language Interfaces Support
                            
                            
                        
                            
                                Appendix B: Support for Third-Party Interfaces
                            
                            
                        
                            
                                Appendix C: Directory Structure in Detail
                            
                            
                        
                            
                            
                                Notices and Disclaimers
                            
                        
                    
                
                                                
                                                
                                                    
                                                    
                                                        OpenMP* Threaded Functions and Problems
                                                    
                                                    
                                                
                                                    
                                                    
                                                        Functions Threaded with Intel® Threading Building Blocks
                                                    
                                                    
                                                
                                                    
                                                    
                                                        Avoiding Conflicts in the Execution Environment
                                                    
                                                    
                                                
                                                    
                                                    
                                                        Techniques to Set the Number of Threads
                                                    
                                                    
                                                
                                                    
                                                    
                                                        Setting the Number of Threads Using an OpenMP* Environment Variable
                                                    
                                                    
                                                
                                                    
                                                    
                                                        Changing the Number of OpenMP* Threads at Run Time
                                                    
                                                    
                                                
                                                    
                                                        Using Additional Threading Control
                                                    
                                                    
                                                    
                                                
                                                    
                                                    
                                                        Calling oneMKL Functions from Multi-threaded Applications
                                                    
                                                    
                                                
                                                    
                                                    
                                                        Using Intel® Hyper-Threading Technology
                                                    
                                                    
                                                
                                                    
                                                    
                                                        Managing Multi-core Performance
                                                    
                                                    
                                                
                                                    
                                                    
                                                        Managing Performance with Heterogeneous Cores
                                                    
                                                    
                                                
                                            
                                        
                                                
                                                
                                                    
                                                    
                                                        Overview of the Intel® Distribution for LINPACK* Benchmark
                                                    
                                                    
                                                
                                                    
                                                    
                                                        Overview of the Intel® Optimized HPL-AI* Benchmark
                                                    
                                                    
                                                
                                                    
                                                    
                                                        Contents of the Intel® Distribution for LINPACK* Benchmark and the Intel® Optimized HPL-AI* Benchmark
                                                    
                                                    
                                                
                                                    
                                                    
                                                        Building the Intel® Distribution for LINPACK* Benchmark and the Intel® Optimized HPL-AI* Benchmark for a Customized MPI Implementation
                                                    
                                                    
                                                
                                                    
                                                    
                                                        Building the Netlib HPL from Source Code
                                                    
                                                    
                                                
                                                    
                                                    
                                                        Configuring Parameters
                                                    
                                                    
                                                
                                                    
                                                    
                                                        Ease-of-use Command-Line Parameters
                                                    
                                                    
                                                
                                                    
                                                    
                                                        Running the Intel® Distribution for LINPACK* Benchmark and the Intel® Optimized HPL-AI* Benchmark
                                                    
                                                    
                                                
                                                    
                                                    
                                                        Heterogeneous Support in the Intel® Distribution for LINPACK* Benchmark
                                                    
                                                    
                                                
                                                    
                                                    
                                                        Environment Variables
                                                    
                                                    
                                                
                                                    
                                                    
                                                        Improving Performance of Your Cluster
                                                    
                                                    
                                                
                                            
                                        
                                                
                                                
                                                    
                                                    
                                                        Overview of the Intel Optimized HPCG
                                                    
                                                    
                                                
                                                    
                                                    
                                                        Versions of the Intel® CPU Optimized HPCG
                                                    
                                                    
                                                
                                                    
                                                    
                                                        Versions of the Intel® GPU Optimized HPCG
                                                    
                                                    
                                                
                                                    
                                                    
                                                        Getting Started with Intel® CPU Optimized HPCG
                                                    
                                                    
                                                
                                                    
                                                    
                                                        Getting Started with Intel® GPU Optimized HPCG
                                                    
                                                    
                                                
                                                    
                                                    
                                                        Choosing the Best Configuration and Problem Sizes for CPUs
                                                    
                                                    
                                                
                                                    
                                                    
                                                        Choosing the Best HPCG Configuration for GPUs
                                                    
                                                    
                                                
                                            
                                        Querying oneMATH Specification Version Compliance
Each Intel® oneAPI Math Kernel Library (oneMKL) domain defines a preprocessor macro to represent the version of the specification that the implementation is compliant with, in accordance with the oneMATH specification.
The macros for each domain are listed as follows:
ONEMATH_BLAS_SPEC_VERSION
ONEMATH_LAPACK_SPEC_VERSION
ONEMATH_SPBLAS_SPEC_VERSION
ONEMATH_DFT_SPEC_VERSION
ONEMATH_RNG_SPEC_VERSION
ONEMATH_STATS_SPEC_VERSION
ONEMATH_VM_SPEC_VERSION
 
  To support modern C++ usage, we also add constexpr of type SpecVersion for each domain in oneapi/mkl/<domain>/spec.hpp:
oneapi::mkl::blas::spec_version
oneapi::mkl::lapack::spec_version
oneapi::mkl::sparse::spec_version
oneapi::mkl::dft::spec_version
oneapi::mkl::rng::spec_version
oneapi::mkl::stats::spec_version
oneapi::mkl::vm::spec_version
 
  To simplify version comparison, we add version enums in include/oneapi/mkl/spec.hpp:
enum class SpecVersion{
    not_compliant = 1,
    version_1_1 = 101,
    version_1_2 = 102,
    version_1_3 = 103,
    version_1_4 = 104,
    not_released
};
 
  C Macro Usage Example
#include <oneapi/mkl/spec.hpp> // or mkl.hpp
#define MY_THRESHOLD_VERSION 102
#ifdef ONEMATH_BLAS_SPEC_VERSION
    #if ONEMATH_BLAS_SPEC_VERSION > MY_THRESHOLD_VERSION
        #define my_call call_optimization_A
    #elif ONEMATH_BLAS_SPEC_VERSION > 001
        #define my_call call_optimization_B
    #else
        #define my_call call_reference
    #endif
#else
    #define my_call call_reference
#endif
int main(){
    my_call();
    return 0;
}
 
  C++ Usage Example
#include <oneapi/mkl/spec.hpp>  // or mkl.hpp
using namespace oneapi::mkl;
int main(){
    SpecVersion my_threshold_version = SpecVersion::version_1_2;
    if (oneapi::mkl::blas::spec_version > my_threshold_version)
        call_optimization_A(); // App's optimization for new spec
    else if (oneapi::mkl::blas::spec_version > SpecVersion::not_compliant)
        call_optimization_B(); // App's optimization for old spec
    else
        call_reference();      // App's reference implementation
    return 0;
}
 
  Compliance Policy
- oneMKL domains can be compliant with any version of the oneMATH specification.
 - oneMKL can increment the compliance version with new releases of oneMKL.
 - A new release of the oneMATH specification does not require updating the oneMKL compliance version.
 
Values
- 1 if the domain does not comply with any released version of the oneMATH specification.
 - <xxyy> if the domain is released with support for one of the available oneMATH specification versions, where xx is the major version and yy is the minor version of the oneMath Specification it is compliant with. For example, the integer value 103 represents oneMATH Specification version 1.3.
 - Versions from 1 through 100 are reserved for alpha/beta support of the specification in oneMKL and should be used only for special cases.
 
 Parent topic: Coding Tips