Skip to content

Commit

Permalink
Add Building with Intel oneAPI (#4920)
Browse files Browse the repository at this point in the history
  • Loading branch information
mizu-bai committed Aug 6, 2023
1 parent 974d112 commit 4c861a0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/how-to-build/how-to-build.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ git submodule update --init
- [Nvidia Jetson](#nvidia-jetson)
- [Raspberry Pi](#raspberry-pi)
- [POWER9](#power9)
- [Intel oneAPI](#intel-oneapi)
- [Verification](#verification)
- [Build for Windows x64 using Visual Studio Community 2017](#build-for-windows-x64-using-visual-studio-community-2017)
- [Build for macOS](#build-for-macos)
Expand Down Expand Up @@ -104,6 +105,14 @@ Earlier versions of Clang may fail to build ncnn due to [Bug 49864](https://gith

Note that the POWER9 toolchain files only support little-endian mode.

#### Intel oneAPI

Besides the prerequests in this section, Intel oneAPI BaseKit and HPCKit should be installed. They are available from https://www.intel.com/content/www/us/en/developer/tools/oneapi/base-toolkit.html and https://www.intel.com/content/www/us/en/developer/tools/oneapi/hpc-toolkit.html freely.

Intel oneAPI offers two kinds of compilers, the classic `icc/icpc` and the LLVM based `icx/icpx`. To build with these compilers, add `CC=icc CXX=icpc` or `CC=icx CXX=icpx` before the `cmake` command. When compiling with `icc/icpc`, cmake will warn that `xop`, `avx512`, and `bf16` extensions are not supported by the compiler, while `icx/icpx` works well.

Both of these compilers have been tested and passed the ncnn benchmark successfully. The results have been included in ncnn benchmark readme. Generally, `icx/icpx` are likely to show better performance than `icc/icpc` and the quantized models can benefit from the extensions `icx/icpx` supports.

#### Verification

Verify build by running some examples:
Expand Down

0 comments on commit 4c861a0

Please sign in to comment.