zhuwenxi commented on code in PR #11326:
URL: https://github.com/apache/tvm/pull/11326#discussion_r893398981
##########
cmake/modules/contrib/LIBXSMM.cmake:
##########
@@ -0,0 +1,31 @@
+if(IS_DIRECTORY ${USE_LIBXSMM})
+ find_library(LIBXSMM_LIBRARY NAMES xsmm HINTS ${USE_LIBXSMM}/lib/)
+ if(LIBXSMM_LIBRARY STREQUAL "LIBXSMM_LIBRARY-NOTFOUND")
+ message(WARNING "Cannot find LIBXSMM library at ${USE_LIBXSMM}/lib/.")
+ else()
+ include_directories(SYSTEM ${USE_LIBXSMM}/include)
+ list(APPEND TVM_RUNTIME_LINKER_LIBS ${LIBXSMM_LIBRARY})
+ MESSAGE(STATUS "Use LIBXSMM library " ${LIBXSMM_LIBRARY})
+
+ tvm_file_glob(GLOB LIBXSMM_RELAY_CONTRIB_SRC
src/relay/backend/contrib/libxsmm/*.cc)
+ list(APPEND COMPILER_SRCS ${LIBXSMM_RELAY_CONTRIB_SRC})
+ tvm_file_glob(GLOB LIBXSMM_RUNTIME_SRC src/runtime/contrib/libxsmm/*.cc)
+ list(APPEND RUNTIME_SRCS ${LIBXSMM_RUNTIME_SRC})
+ endif()
+elseif(USE_LIBXSMM STREQUAL "ON")
+ find_library(LIBXSMM_LIBRARY xsmm)
+ if(LIBXSMM_LIBRARY STREQUAL "LIBXSMM_LIBRARY-NOTFOUND")
+ message(WARNING "Cannot find LIBXSMM library at $(USE_LIBXSMM).")
+ else()
+ list(APPEND TVM_RUNTIME_LINKER_LIBS ${LIBXSMM_LIBRARY})
+ MESSAGE(STATUS "Use LIBXSMM library " ${LIBXSMM_LIBRARY})
+
+ tvm_file_glob(GLOB LIBXSMM_RELAY_CONTRIB_SRC
src/relay/backend/contrib/libxsmm/*.cc)
+ list(APPEND COMPILER_SRCS ${LIBXSMM_RELAY_CONTRIB_SRC})
+ tvm_file_glob(GLOB LIBXSMM_RUNTIME_SRC src/runtime/contrib/libxsmm/*.cc)
+ list(APPEND RUNTIME_SRCS ${LIBXSMM_RUNTIME_SRC})
+ endif()
Review Comment:
I'm not sure which part could be merged. I followed the flavor of
https://github.com/apache/tvm/blob/main/cmake/modules/contrib/DNNL.cmake
exactly. From my point of view, only those 4 `tvm_file_glob` lines could be
merged. Do you have any sugguestions?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]