# Intel® oneAPI Math Kernel Library (oneMKL)

Accelerate math processing routines, increase application performance, and reduce development time.

### High Performance for Numerical Computing on CPUs and GPUs

- Fast, efficient, easy-to-use math library
- Optimized for Intel® CPUs, GPUs, and other accelerators
- Versatile, robust functionality for:
- Dense linear algebra
- Sparse linear algebra
- Fast Fourier transforms (FFT)
- Vector math (VM)
- Random number generators (RNG)
- Summary statistics

##### Why oneMKL?

- The fastest and most-used math library for Intel®-based systems.
^{†}

- Create highly-performant applications faster.
- Fully use Intel hardware capabilities for AI, HPC, and data science.
- Seamlessly upgrade from the previous solution (Intel® MKL).
- Reach high performance with math solutions like NumPy, SciPy, MATLAB*.
- Comprehensive standard interface support for BLAS, LAPACK, and FFTW.

##### What’s New

- The oneMKL library for SYCL* was partitioned to provide a smaller binary footprint for developers and users of oneMKL
- Increased CUDA* library function API compatibility coverage on Intel CPUs and GPUs
- Delivers High-Performance LINPACK (HPL) and HPL-AI benchmarks optimized for Intel® Xeon® CPU Max Series and Intel® Data Center GPU Max Series
- BLAS
- Improved general performance of GEMV and several BLAS level-1 routines on Intel Data Center GPU Max Series

- DFT
- Enables FFT larger than 4 GiB (up to 64 GiB of data) on Intel Data Center GPU Max Series
- Improved FFT performance on Intel Data Center GPU Max Series

- LAPACK
- Introducing SYCL APIs to compute nonpivoting LU factorization with C and Fortran OpenMP* offload support
- Introducing SYCL APIs to compute batched matrix inverse of a group of general matrices

- Vector Math
- Integrates vector math optimizations into random number generators for high-performance computing
- Supports vector math for FP16 datatype on Intel GPUs
- Added OpenMP 5.1 for C offload support

##### Download as Part of the Toolkit

oneMKL is included in the Intel oneAPI Base Toolkit, which is a core set of tools and libraries for developing high-performance, data-centric applications across diverse architectures.

##### Download the Stand-Alone Version

A stand-alone download of oneMKL is available. You can download binaries from Intel or choose your preferred repository.

##### Develop in the Cloud

Build and optimize oneAPI multiarchitecture applications using the latest Intel-optimized oneAPI and AI tools, and test your workloads across Intel® CPUs and GPUs. No hardware installations, software downloads, or configuration necessary.

##### Help oneMKL Evolve

oneMKL is part of the oneAPI industry standards initiative. We welcome you to participate.

##### What You Need

- Get started by choosing the best interface for your application:
- oneMKL is available as part of the Intel® oneAPI Base Toolkit.
- Using oneMKL with Intel® MPI library or Intel® Fortran Compilers requires the Intel® HPC Toolkit.

## Features

**Linear Algebra**

Speed up linear algebra computations with low-level routines that operate on vectors and matrices, and are compatible with these industry-standard BLAS and LAPACK operations:

- Level 1: Vector-vector operations
- Level 2: Matrix-vector operations
- Level 3: Matrix-matrix operations

Sparse Linear Algebra Functions

Perform various operations on sparse matrices with low-level and inspector-executor routines including the following:

- Multiply sparse matrix with dense vector
- Multiply sparse matrix with dense matrix
- Solve linear systems with triangular sparse matrices
- Solve linear systems with general sparse matrices

**Fast Fourier Transforms (FFT)**

Transform a signal from its original domain (typically time or space) into a representation in the frequency domain and back. Use FFT functions in one, two, or three dimensions with support for mixed radices. The supported functions include complex-to-complex and real-to-complex transforms of arbitrary length in single-precision and double-precision.

**Random Number Generator Functions (RNG)**

Use common pseudorandom, quasi-random, and nondeterministic random number engines to solve continuous and discrete distributions.

**Data Fitting**

Provide spline-based interpolation capabilities that you can use to approximate functions, function derivatives or integrals, and perform cell search operations.

**Vector Math**

Balance accuracy and performance with vector-based elementary functions. Manipulate values with traditional algebraic and trigonometric functions.

**Summary Statistics **

Compute basic statistical estimates (such as raw or central sums and moments) for single- and double-precision multidimensional datasets.

## Benchmarks

These benchmarks are offered to help you make informed decisions about which routines to use in your applications, including performance for each major function domain in oneMKL by processor family. Some benchmark charts only include absolute performance measurements for specific problem sizes. Others compare previous versions, popular alternate open source libraries, and other functions for oneMKL.

To assess performance in high-performance computing environments, see the oneMKL Benchmarks Suite. It includes:

- Intel® Distribution for LINPACK* Benchmark
- Intel® Distribution for MP LINPACK* Benchmark for clusters
- Intel® Optimized High Performance Conjugate Gradient Benchmark

## Documentation & Code Samples

##### Documentation

- Get Started Guide
- Release Notes
- System Requirements
- Developer References:

C | Fortran | SYCL - Developer Guides:

Windows* | Linux*

View Current oneMKL Documentation

View Legacy Intel® Math Kernel Library Documentation

##### Library Linking Guidance

Intel® oneAPI Math Kernel Library Link Line Advisor

This web-based utility identifies which build options for compiler and linker to use with oneMKL, depending on the build environment you use and the feature set you want to enable.

##### Code Samples

**Linear Algebra**

- Matrix Multiplication with CPUs and GPUs

Use this sample to examine the oneMKL matrix multiplication functionality. - Block Cholesky Decomposition

Learn how to use oneMKL routines for matrix multiplication, rank-k updates, triangular solves (BLAS), and Cholesky factorization (LAPACK).

**Migration to SYCL***

- Fourier Correlation

Learn how to implement the Fourier correlation algorithm using SYCL, oneMKL, and Intel® oneAPI DPC++ Library (oneDPL) functions. - cuBLAS Migration

Use this set of samples to see how cuBLAS routines are transformed to equivalent oneMKL routines after migrating CUDA-based code to SYCL. - Matrix Multiplication cuBLAS Migrated

Learn how to migrate your code to SYCL and use it in a high-performance way, offloading computations to GPU or CPU. See how to optimize the migration steps and improve processing time. - OceanFFT Sample Code cuFFT Migration

The OceanFFT sample simulates an ocean heightfield using oneMKL FFT functionality. Learn how original CUDA source code is migrated to SYCL for portability - MonteCarloMultiGPU Sample for cuRAND Migration

The MonteCarloMultiGPU sample evaluates fair call price for a given set of European options using the Monte Carlo approach. Learn how to migrate and map cuRAND generator calls to their oneMKL and SYCL API random number generator equivalent.

**For Your Industry**

**Finance:**Monte Carlo European Options

See how to use the oneMKL random number generator (RNG) functionality to compute European option prices.**Finance:**Black-Scholes

Learn how to use vector math and the RNG available in oneMKL to calculate the prices of options using the Black-Scholes formula.**Healthcare:**Computed Tomography Reconstruction

Learn how to use discrete Fourier transform (DFT) routines to transform raw computed tomography (CT) data into a reconstructed image of the scanned object.

How to work with code samples:

## Training Resources

**Get Started**

- A Quick Overview of oneMKL [5:47]
- NEW Benefits of oneMKL on CPUs and GPUs [4.55]
- oneMKL - an Advanced Version of Intel® MKL
- oneMKL Essentials Learning Path
- How to Use oneMKL
- oneMKL Linking
- oneMKL Verbose Mode: Quick and Easy GPU Library Execution Profiler

**Expert Talks**

- Why oneMKL? Accelerate Math Computation on the Latest Hardware [59:07]
- Speed Up Math Computations on GPUs with oneMKL [45:22]

**Take Advantage of GPUs with SYCL**

- How to Move from CUDA Math Library Calls to oneMKL
- NEW Migrate cuBLAS and cuRAND Operations from CUDA to SYCL
- NEW Random Number Generation with cuRAND and oneMKL

- A C++ API with SYCL Support for Data Fitting

**Fourier Transform**

- Implement the Fourier Correlation Algorithm [47:37]
- Implement the Fourier Correlation Algorithm Using oneAPI

**Random Number Generation**

## Specifications

**Processors:**

- Intel Atom® processors
- Intel® Core™ processors
- Intel® Xeon® Scalable processors

GPUs:

- Intel® UHD Graphics for 11th generation Intel processors or newer
- Intel® Iris® X
^{e}graphics - Intel® Arc™ graphics
- Intel® Data Center GPU Flex Series
- Intel® Data Center GPU Max Series

Languages:

- SYCL
- C and C++
- Fortran

For more information, see the system requirements.

**Operating systems:**

- Windows
- Linux

Compilers:

- Intel® oneAPI DPC++/C++ Compiler
- GNU Compiler Collection (GCC)*
- Intel Fortran Compiler
- Intel Fortran Compiler Classic
- Other compilers that follow the same standards

**Development environments:**

- Windows: Microsoft Visual Studio*
- Linux: Eclipse* and Eclipse CDT (C/C++ Development Tooling)*

Threading models:

- Intel® oneAPI Threading Building Blocks
- OpenMP

## Get Help

Your success is our success. Access these support resources when you need assistance.

### Stay In the Know on All Things CODE

Sign up to receive the latest trends, tutorials, tools, training, and more to

help you write better code optimized for CPUs, GPUs, FPGAs, and other

accelerators—stand-alone or in any combination.