Add support for system pkgs: onednn

This commit is contained in:
Damien Nguyen 2022-02-25 09:09:56 +01:00
parent 116703d769
commit 67d5bf2358
No known key found for this signature in database
GPG Key ID: 1E9F14CEB9969EF8
1 changed files with 11 additions and 14 deletions

View File

@ -9,22 +9,19 @@ endif()
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
set(ARGS HEAD_ONLY ./include RELEASE on)
set(VERSION 2.2)
set(REQ_URL https://github.com/oneapi-src/oneDNN/releases/download/v2.2/dnnl_win_2.2.0_cpu_vcomp.zip)
set(MD5 fa12c693b2ec07700d174e1e99d60a7e)
else()
set(VERSION 2.5.0)
if(ENABLE_GITEE)
set(REQ_URL "https://gitee.com/mirrors/MKL-DNN/repository/archive/v2.2.tar.gz")
set(MD5 "49c650e0cc24ef9ae7033d4cb22ebfad")
set(REQ_URL "https://gitee.com/mirrors/MKL-DNN/repository/archive/v2.5.2.tar.gz")
set(MD5 "fe4819264dcac225596bd30a1756ce8c")
else()
set(REQ_URL "https://github.com/oneapi-src/oneDNN/archive/v2.2.tar.gz")
set(MD5 "6a062e36ea1bee03ff55bf44ee243e27")
set(REQ_URL "https://github.com/oneapi-src/oneDNN/archive/v2.5.2.tar.gz")
set(MD5 "fff1c259d9f0bc87f2b3ca257acd472e")
endif()
set(ARGS
PATCHES
${CMAKE_SOURCE_DIR}/third_party/patch/onednn/0001-fix-user-threadpool-bug.patch
PATCHES
${CMAKE_SOURCE_DIR}/third_party/patch/onednn/0002-fix-pool-nthr-bug.patch
CMAKE_OPTION
-DDNNL_ARCH_OPT_FLAGS=''
-DDNNL_BUILD_EXAMPLES=OFF
@ -34,12 +31,12 @@ else()
endif()
mindspore_add_pkg(
onednn
VER 2.2
LIBS dnnl mkldnn
DNNL
VER ${VERSION}
LIBS dnnl
URL ${REQ_URL}
MD5 ${MD5} ${ARGS}
TARGET_ALIAS mindspore::dnnl onednn::dnnl
TARGET_ALIAS mindspore::mkldnn onednn::mkldnn)
TARGET_ALIAS mindspore::dnnl DNNL::dnnl
TARGET_ALIAS mindspore::mkldnn DNNL::dnnl)
include_directories(${onednn_INC})