You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

MKL_DNN.cmake 924 B

12345678910111213141516171819202122232425
  1. if (MGE_USE_SYSTEM_LIB)
  2. find_package(dnnl)
  3. if (dnnl_FOUND)
  4. message(STATUS "Using system provided MKL-DNN.")
  5. set (MGE_USE_SYSTEM_MKLDNN ON)
  6. return()
  7. endif()
  8. endif()
  9. option(DNNL_BUILD_TESTS "" OFF)
  10. option(DNNL_BUILD_EXAMPLES "" OFF)
  11. # we do not want to use OMP now, so config to CPU mode
  12. # if set to OMP, some dnnl algo will be more fast
  13. set(DNNL_CPU_RUNTIME "SEQ" CACHE STRING "config dnnl to DNNL_RUNTIME_SEQ")
  14. if(MGE_BLAS STREQUAL "MKL")
  15. option(_DNNL_USE_MKL "" ON)
  16. set(MKLROOT ${MKL_ROOT_DIR} CACHE STRING "MKL ROOT FOR DNNL")
  17. set(MKLLIB libmkl)
  18. else()
  19. option(_DNNL_USE_MKL "" OFF)
  20. endif()
  21. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-parameter -Wno-extra")
  22. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-parameter -Wno-extra")
  23. set(DNNL_LIBRARY_TYPE STATIC CACHE STRING "config dnnl to STATIC")
  24. add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/intel-mkl-dnn)