Home

Awesome

<img src="https://github.com/uxlfoundation/artwork/blob/main/foundation/uxl-foundation-logo-horizontal-color.png" alt="UXL Foundation Logo" width="250"/>

oneAPI Math Library (oneMath)

oneMath is an open-source implementation of the oneMath specification. It can work with multiple devices using multiple libraries (backends) underneath. The oneMath project was previously referred to as oneMKL Interfaces.

oneMath is part of the UXL Foundation. <br/><br/>

<table> <thead> <tr align="center" > <th>User Application</th> <th>oneMath Layer</th> <th>Third-Party Library</th> <th>Hardware Backend</th> </tr> </thead> <tbody> <tr> <td rowspan=14 align="center">oneMath</td> <td rowspan=14 align="center">oneMath selector</td> <td align="center"><a href="https://software.intel.com/en-us/oneapi/onemkl">Intel(R) oneAPI Math Kernel Library (oneMKL)</a></td> <td align="center">x86 CPU, Intel GPU</td> </tr> </tr> <tr> <td align="center"><a href="https://developer.nvidia.com/cublas"> NVIDIA cuBLAS</a></td> <td align="center">NVIDIA GPU</td> </tr> <tr> <td align="center"><a href="https://developer.nvidia.com/cusolver"> NVIDIA cuSOLVER</a></td> <td align="center">NVIDIA GPU</td> </tr> <tr> <td align="center"><a href="https://developer.nvidia.com/curand"> NVIDIA cuRAND</a></td> <td align="center">NVIDIA GPU</td> </tr> <tr> <td align="center"><a href="https://developer.nvidia.com/cufft"> NVIDIA cuFFT</a></td> <td align="center">NVIDIA GPU</td> </tr> <tr> <td align="center"><a href="https://developer.nvidia.com/cusparse"> NVIDIA cuSPARSE</a></td> <td align="center">NVIDIA GPU</td> </tr> <tr> <td align="center"><a href="https://ww.netlib.org"> NETLIB LAPACK</a> </td> <td align="center">x86 CPU</td> </tr> <tr> <td align="center"><a href="https://rocblas.readthedocs.io/en/rocm-4.5.2/"> AMD rocBLAS</a></td> <td align="center">AMD GPU</td> </tr> <tr> <td align="center"><a href="https://github.com/ROCmSoftwarePlatform/rocSOLVER"> AMD rocSOLVER</a></td> <td align="center">AMD GPU</td> </tr> <tr> <td align="center"><a href="https://github.com/ROCmSoftwarePlatform/rocRAND"> AMD rocRAND</a></td> <td align="center">AMD GPU</td> </tr> <tr> <td align="center"><a href="https://github.com/ROCmSoftwarePlatform/rocFFT"> AMD rocFFT</a></td> <td align="center">AMD GPU</td> </tr> <tr> <td align="center"><a href="https://github.com/ROCmSoftwarePlatform/rocSPARSE"> AMD rocSPARSE</a></td> <td align="center">AMD GPU</td> </tr> <tr> <td align="center"><a href="https://github.com/uxlfoundation/generic-sycl-components/tree/main/onemath/sycl/blas"> generic SYCL BLAS </a></td> <td align="center">x86 CPU, Intel GPU, NVIDIA GPU, AMD GPU, Other SYCL devices (unsupported)</td> </tr> <tr> <td align="center"><a href="https://github.com/codeplaysoftware/portFFT"> portFFT </a></td> <td align="center">x86 CPU, Intel GPU, NVIDIA GPU, AMD GPU, Other SYCL devices (unsupported)</td> </tr> </tbody> </table>

Table of Contents


Support and Requirements

Supported Usage Models:

Host API

There are two oneMath selector layer implementations:

Refer to Selecting a Compiler for the choice between icpx/icx and clang++ compilers.

Device API

Header-based and backend-independent Device API can be called within sycl kernel or work from Host code (device-rng-usage-model-example). Currently, the following domains support the Device API:

Supported Configurations:

Supported domains include: BLAS, LAPACK, RNG, DFT, SPARSE_BLAS

Supported compilers include:

Linux*

<table> <thead> <tr align="center" > <th>Domain</th> <th>Backend</th> <th>Library</th> <th>Supported Compiler</th> <th>Supported Link Type</th> </tr> </thead> <tbody> <tr> <td rowspan=10 align="center">BLAS</td> <td rowspan=3 align="center">x86 CPU</td> <td align="center">Intel(R) oneMKL</td> <td align="center">Intel DPC++</br>AdaptiveCpp</td> <td align="center">Dynamic, Static</td> </tr> <tr> <td align="center">NETLIB LAPACK</td> <td align="center">Intel DPC++</br>Open DPC++</br>AdaptiveCpp</td> <td align="center">Dynamic, Static</td> </tr> <tr> <td align="center">generic SYCL BLAS</td> <td align="center">Intel DPC++</br>Open DPC++</td> <td align="center">Dynamic, Static</td> </tr> <tr> <td rowspan=2 align="center">Intel GPU</td> <td align="center">Intel(R) oneMKL</td> <td align="center">Intel DPC++</td> <td align="center">Dynamic, Static</td> </tr> <tr> <td align="center">generic SYCL BLAS</td> <td align="center">Intel DPC++</br>Open DPC++</td> <td align="center">Dynamic, Static</td> </tr> <tr> <td rowspan=2 align="center">NVIDIA GPU</td> <td align="center">NVIDIA cuBLAS</td> <td align="center">Open DPC++</br>AdaptiveCpp</td> <td align="center">Dynamic, Static</td> </tr> <tr> <td align="center">generic SYCL BLAS</td> <td align="center">Open DPC++</td> <td align="center">Dynamic, Static</td> </tr> <tr> <td rowspan=2 align="center">AMD GPU</td> <td align="center">AMD rocBLAS</td> <td align="center">Open DPC++</br>AdaptiveCpp</td> <td align="center">Dynamic, Static</td> </tr> <tr> <td align="center">generic SYCL BLAS</td> <td align="center">Open DPC++</td> <td align="center">Dynamic, Static</td> </tr> <tr> <td rowspan=1 align="center">Other SYCL devices (unsupported)</td> <td align="center">generic SYCL BLAS</td> <td align="center">Intel DPC++</br>Open DPC++</td> <td align="center">Dynamic, Static</td> </tr> <tr> <td rowspan=4 align="center">LAPACK</td> <td align="center">x86 CPU</td> <td align="center">Intel(R) oneMKL</td> <td align="center">Intel DPC++</td> <td align="center">Dynamic, Static</td> </tr> <tr> <td align="center">Intel GPU</td> <td align="center">Intel(R) oneMKL</td> <td align="center">Intel DPC++</td> <td align="center">Dynamic, Static</td> </tr> <tr> <td align="center">NVIDIA GPU</td> <td align="center">NVIDIA cuSOLVER</td> <td align="center">Open DPC++</td> <td align="center">Dynamic, Static</td> </tr> <tr> <td align="center">AMD GPU</td> <td align="center">AMD rocSOLVER</td> <td align="center">Open DPC++</td> <td align="center">Dynamic, Static</td> </tr> <tr> <td rowspan=4 align="center">RNG</td> <td align="center">x86 CPU</td> <td align="center">Intel(R) oneMKL</td> <td align="center">Intel DPC++</br>AdaptiveCpp</td> <td align="center">Dynamic, Static</td> </tr> <tr> <td align="center">Intel GPU</td> <td align="center">Intel(R) oneMKL</td> <td align="center">Intel DPC++</td> <td align="center">Dynamic, Static</td> </tr> <tr> <td align="center">NVIDIA GPU</td> <td align="center">NVIDIA cuRAND</td> <td align="center">Open DPC++</br>AdaptiveCpp</td> <td align="center">Dynamic, Static</td> </tr> <tr> <td align="center">AMD GPU</td> <td align="center">AMD rocRAND</td> <td align="center">Open DPC++</br>AdaptiveCpp</td> <td align="center">Dynamic, Static</td> </tr> <tr> <td rowspan=9 align="center">DFT</td> <td rowspan=2 align="center">x86 CPU</td> <td align="center">Intel(R) oneMKL</td> <td align="center">Intel DPC++</td> <td align="center">Dynamic, Static</td> </tr> <tr> <td align="center">portFFT (<a href="https://github.com/codeplaysoftware/portFFT#supported-configurations">limited API support</a>)</td> <td align="center">Intel DPC++</td> <td align="center">Dynamic, Static</td> </tr> <tr> <td rowspan=2 align="center">Intel GPU</td> <td align="center">Intel(R) oneMKL</td> <td align="center">Intel DPC++</td> <td align="center">Dynamic, Static</td> </tr> <tr> <td align="center">portFFT (<a href="https://github.com/codeplaysoftware/portFFT#supported-configurations">limited API support</a>)</td> <td align="center">Intel DPC++</td> <td align="center">Dynamic, Static</td> </tr> <tr> <td rowspan=2 align="center">NVIDIA GPU</td> <td align="center">NVIDIA cuFFT</td> <td align="center">Open DPC++</td> <td align="center">Dynamic, Static</td> </tr> <tr> <td align="center">portFFT (<a href="https://github.com/codeplaysoftware/portFFT#supported-configurations">limited API support</a>)</td> <td align="center">Open DPC++</td> <td align="center">Dynamic, Static</td> </tr> <tr> <td rowspan=2 align="center">AMD GPU</td> <td align="center">AMD rocFFT</td> <td align="center">Open DPC++</td> <td align="center">Dynamic, Static</td> </tr> <tr> <td align="center">portFFT (<a href="https://github.com/codeplaysoftware/portFFT#supported-configurations">limited API support</a>)</td> <td align="center">Open DPC++</td> <td align="center">Dynamic, Static</td> </tr> <tr> <td rowspan=1 align="center">Other SYCL devices (unsupported)</td> <td align="center">portFFT</td> <td align="center">Open DPC++</br>Open DPC++</td> <td align="center">Dynamic, Static</td> </tr> <tr> <td rowspan=4 align="center">SPARSE_BLAS</td> <td align="center">x86 CPU</td> <td align="center">Intel(R) oneMKL</td> <td align="center">Intel DPC++</td> <td align="center">Dynamic, Static</td> </tr> <tr> <td align="center">Intel GPU</td> <td align="center">Intel(R) oneMKL</td> <td align="center">Intel DPC++</td> <td align="center">Dynamic, Static</td> </tr> <tr> <td align="center">NVIDIA GPU</td> <td align="center">NVIDIA cuSPARSE</td> <td align="center">Open DPC++</td> <td align="center">Dynamic, Static</td> </tr> <tr> <td align="center">AMD GPU</td> <td align="center">AMD rocSPARSE</td> <td align="center">Open DPC++</td> <td align="center">Dynamic, Static</td> </tr> </tbody> </table>

Windows*

<table> <thead> <tr align="center" > <th>Domain</th> <th>Backend</th> <th>Library</th> <th>Supported Compiler</th> <th>Supported Link Type</th> </tr> </thead> <tbody> <tr> <td rowspan=3 align="center">BLAS</td> <td rowspan=2 align="center">x86 CPU</td> <td align="center">Intel(R) oneMKL</td> <td align="center">Intel DPC++</td> <td align="center">Dynamic, Static</td> </tr> <tr> <td align="center">NETLIB LAPACK</td> <td align="center">Intel DPC++</br>Open DPC++</td> <td align="center">Dynamic, Static</td> </tr> <tr> <td align="center">Intel GPU</td> <td align="center">Intel(R) oneMKL</td> <td align="center">Intel DPC++</td> <td align="center">Dynamic, Static</td> </tr> <tr> <td rowspan=2 align="center">LAPACK</td> <td align="center">x86 CPU</td> <td align="center">Intel(R) oneMKL</td> <td align="center">Intel DPC++</td> <td align="center">Dynamic, Static</td> </tr> <tr> <td align="center">Intel GPU</td> <td align="center">Intel(R) oneMKL</td> <td align="center">Intel DPC++</td> <td align="center">Dynamic, Static</td> </tr> <tr> <td rowspan=2 align="center">RNG</td> <td align="center">x86 CPU</td> <td align="center">Intel(R) oneMKL</td> <td align="center">Intel DPC++</td> <td align="center">Dynamic, Static</td> </tr> <tr> <td align="center">Intel GPU</td> <td align="center">Intel(R) oneMKL</td> <td align="center">Intel DPC++</td> <td align="center">Dynamic, Static</td> </tr> </tbody> </table>

Hardware Platform Support


Supported Operating Systems

Linux*

BackendSupported Operating System
x86 CPURed Hat Enterprise Linux* 9 (RHEL* 9)
Intel GPUUbuntu 24.04 LTS
NVIDIA GPUUbuntu 22.04 LTS

Windows*

BackendSupported Operating System
x86 CPUMicrosoft Windows* Server 2022
Intel GPUMicrosoft Windows* 11

Software Requirements

What should I download?

General:

<table> <thead> <tr align="center"> <th> Functional Testing </th> <th> Build Only </th> <th>Documentation</th> </tr> </thead> <tbody> <tr> <td colspan=3 align=center> CMake (version 3.13 or newer) </td> </tr> <tr> <td colspan=3 align=center> Linux* : GNU* GCC 5.1 or higher <br> Windows* : MSVS* 2017 or MSVS* 2019 (version 16.5 or newer) </td> </tr> <tr> <tr> <td colspan=3 align=center> Ninja (optional) </td> </tr> <tr> <td> GNU* FORTRAN Compiler </td> <td> - </td> <td> Sphinx </td> </tr> <tr> <td> NETLIB LAPACK </td> <td> - </td> <td> - </td> </tr> </tr> </tbody> </table>

Hardware and OS Specific:

<table> <thead> <tr align="center"> <th>Operating System</th> <th>Device</th> <th>Package</th> </tr> </thead> <tbody> <td rowspan=5> Linux*/Windows* </td> <td rowspan=2> x86 CPU </td> <td> Intel(R) oneAPI DPC++ Compiler <br> or <br> oneAPI DPC++ Compiler </td> <tr> <td> Intel(R) oneAPI Math Kernel Library </td> </tr> <td rowspan=3> Intel GPU </td> <td> Intel(R) oneAPI DPC++ Compiler </td> <tr> <td> Intel GPU driver </td> </tr> <tr> <td> Intel(R) oneAPI Math Kernel Library </td> </tr> <td rowspan=2> Linux* only </td> <td> NVIDIA GPU </td> <td> oneAPI DPC++ Compiler <br> or <br> AdaptiveCpp with CUDA backend and dependencies </td> <tr> <td> AMD GPU </td> <td> oneAPI DPC++ Compiler <br> or <br> AdaptiveCpp with ROCm backend and dependencies </td> </tr> </tbody> </table>

Product and Version Information:

ProductSupported VersionLicense
CMake3.13 or higherThe OSI-approved BSD 3-clause License
Ninja1.10.0Apache License v2.0
GNU* FORTRAN Compiler7.4.0 or higherGNU General Public License, version 3
Intel(R) oneAPI DPC++ CompilerLatestEnd User License Agreement for the Intel(R) Software Development Products
AdaptiveCppLater than 2cfa530BSD-2-Clause License
oneAPI DPC++ Compiler binary for x86 CPUDaily buildsApache License v2
oneAPI DPC++ Compiler source for NVIDIA and AMD GPUsDaily source releasesApache License v2
Intel(R) oneAPI Math Kernel LibraryLatestIntel Simplified Software License
NVIDIA CUDA SDK12.0End User License Agreement
AMD rocBLAS4.5AMD License
AMD rocRAND5.1.0AMD License
AMD rocSOLVER5.0.0AMD License
AMD rocFFTrocm-5.4.3AMD License
AMD rocSPARSE3.1.2AMD License
NETLIB LAPACK5d4180cBSD like license
Generic SYCL BLAS0.1Apache License v2.0
portFFT0.1Apache License v2.0

Documentation


Governance

The oneMath project is governed by the UXL Foundation and you can get involved in this project in multiple ways. It is possible to join the Math Special Interest Group (SIG) meetings where the group discusses and demonstrates work using this project. Members can also join the Open Source and Specification Working Group meetings.

You can also join the mailing lists for the UXL Foundation to be informed of when meetings are happening and receive the latest information and discussions.


Contributing

You can contribute to this project and also contribute to the specification for this project. Please read the CONTRIBUTING page for more information. You can also contact oneMath developers and maintainers via UXL Foundation Slack using #onemath channel.


License

Distributed under the Apache license 2.0. See LICENSE for more information.


FAQs

oneMath

Q: What is the difference between the following items?

A:

Q: I'm trying to use oneMath in my project using FetchContent, but I keep running into ONEMATH::SYCL::SYCL target was not found problem when I try to build the project. What should I do?

A: Make sure you set the compiler when you configure your project. E.g. cmake -Bbuild . -DCMAKE_CXX_COMPILER=icpx.

Q: I'm trying to use oneMath in my project using find_package(oneMath). I set oneMath/oneTBB and Compiler environment first, then I built and installed oneMath, and finally I tried to build my project using installed oneMath (e.g. like this cmake -Bbuild -GNinja -DCMAKE_CXX_COMPILER=icpx -DoneMath_ROOT=<path_to_installed_oneMath> .) and I noticed that cmake includes installed oneMath headers as a system include which ends up as a lower priority than the installed Intel(R) oneAPI Math Kernel Library package includes which I set before for building oneMath. As a result, I get conflicts between Intel(R) oneAPI Math Kernel Library and installed oneMath headers. What should I do?

A: Having installed oneMath headers as -I instead on system includes (as -isystem) helps to resolve this problem. We use INTERFACE_INCLUDE_DIRECTORIES to add paths to installed oneMath headers (check oneMathTargets.cmake in lib/cmake to find it). It's a known limitation that INTERFACE_INCLUDE_DIRECTORIES puts headers paths as system headers. To avoid that:


Legal information