mindspore/cmake/external_libs/mkl_dnn.cmake

30 lines
1.1 KiB
CMake
Raw Normal View History

2020-04-07 11:22:53 +08:00
set(onednn_CXXFLAGS "-D_FORTIFY_SOURCE=2 -O2")
set(onednn_CFLAGS "-D_FORTIFY_SOURCE=2 -O2")
2021-01-23 20:20:31 +08:00
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
2020-04-15 17:36:48 +08:00
mindspore_add_pkg(onednn
2020-11-04 15:30:38 +08:00
VER 1.6
2020-04-15 17:36:48 +08:00
LIBS dnnl mkldnn
2020-04-26 20:51:18 +08:00
HEAD_ONLY ./include
2020-04-15 17:36:48 +08:00
RELEASE on
2020-11-04 15:30:38 +08:00
URL https://github.com/oneapi-src/oneDNN/releases/download/v1.6/dnnl_win_1.6.0_cpu_vcomp.zip
MD5 fe660e34e9f73ab13a65987819a0712e)
2020-04-15 17:36:48 +08:00
else()
2021-01-23 20:20:31 +08:00
if(ENABLE_GITEE)
set(REQ_URL "https://gitee.com/mirrors/MKL-DNN/repository/archive/v2.1.2.tar.gz")
set(MD5 "d98f171d7e66e252c79e2e167ba4a8e8")
else()
set(REQ_URL "https://github.com/oneapi-src/oneDNN/archive/v2.1.2.tar.gz")
set(MD5 "1df4f16f650b7ea08610a10af013faa3")
2021-01-23 20:20:31 +08:00
endif()
2020-04-15 17:36:48 +08:00
mindspore_add_pkg(onednn
VER 2.1.2
LIBS dnnl mkldnn
URL ${REQ_URL}
MD5 ${MD5}
2020-11-04 15:30:38 +08:00
CMAKE_OPTION -DDNNL_ARCH_OPT_FLAGS='' -DDNNL_BUILD_EXAMPLES=OFF -DDNNL_BUILD_TESTS=OFF)
2020-04-15 17:36:48 +08:00
endif()
2020-04-07 11:22:53 +08:00
include_directories(${onednn_INC})
add_library(mindspore::dnnl ALIAS onednn::dnnl)
add_library(mindspore::mkldnn ALIAS onednn::mkldnn)