• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1set(onednn_CXXFLAGS "-D_FORTIFY_SOURCE=2 -O2")
2set(onednn_CFLAGS "-D_FORTIFY_SOURCE=2 -O2")
3if(CMAKE_SYSTEM_NAME MATCHES "Windows")
4    mindspore_add_pkg(onednn
5        VER 2.2
6        LIBS dnnl mkldnn
7        HEAD_ONLY ./include
8        RELEASE on
9        URL https://github.com/oneapi-src/oneDNN/releases/download/v2.2/dnnl_win_2.2.0_cpu_vcomp.zip
10        MD5 fa12c693b2ec07700d174e1e99d60a7e)
11else()
12    if(ENABLE_GITEE)
13        set(REQ_URL "https://gitee.com/mirrors/MKL-DNN/repository/archive/v2.2.tar.gz")
14        set(MD5 "ac34c03a0ff31eb88dfe805967b9c351")
15    else()
16        set(REQ_URL "https://github.com/oneapi-src/oneDNN/archive/v2.2.tar.gz")
17        set(MD5 "6a062e36ea1bee03ff55bf44ee243e27")
18    endif()
19    mindspore_add_pkg(onednn
20        VER 2.2
21        LIBS dnnl mkldnn
22        URL ${REQ_URL}
23        MD5 ${MD5}
24        CMAKE_OPTION -DDNNL_ARCH_OPT_FLAGS='' -DDNNL_BUILD_EXAMPLES=OFF -DDNNL_BUILD_TESTS=OFF
25            -DDNNL_ENABLE_CONCURRENT_EXEC=ON)
26endif()
27
28include_directories(${onednn_INC})
29add_library(mindspore::dnnl ALIAS onednn::dnnl)
30add_library(mindspore::mkldnn ALIAS onednn::mkldnn)
31