TaoLv commented on a change in pull request #4323: [Contrib] Add MKL DNN option
URL: https://github.com/apache/incubator-tvm/pull/4323#discussion_r346094433
 
 

 ##########
 File path: cmake/modules/contrib/BLAS.cmake
 ##########
 @@ -55,3 +55,11 @@ elseif(USE_BLAS STREQUAL "none")
 else()
   message(FATAL_ERROR "Invalid option: USE_BLAS=" ${USE_BLAS})
 endif()
+
+if(USE_MKL_DNN STREQUAL "ON")
+  find_library(BLAS_LIBRARY_MKLDNN dnnl)
+  list(APPEND TVM_RUNTIME_LINKER_LIBS ${BLAS_LIBRARY_MKLDNN})
+  list(APPEND RUNTIME_SRCS ${CBLAS_CONTRIB_SRC})
+  add_definitions(-DUSE_MKL_DNN=1)
+  message(STATUS "Use MKL DNN library " ${BLAS_LIBRARY_MKLDNN})
+endif()
 
 Review comment:
   Another minor nit is to change `USE_MKL_DNN` to either `USE_DNNL` or 
`USE_MKLDNN`. The first one aligns with the renaming trend of the library. The 
second one follows the coding convention in MKL-DNN before renaming and in 
other projects like MXNet.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to