2021-05-18 14:22:24 +08:00
|
|
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
2023-01-19 03:06:34 +08:00
|
|
|
index 2ca06ee..b0d8873 100644
|
2021-05-18 14:22:24 +08:00
|
|
|
--- a/CMakeLists.txt
|
|
|
|
+++ b/CMakeLists.txt
|
2023-01-19 03:06:34 +08:00
|
|
|
@@ -6526,7 +6526,7 @@ ELSE()
|
|
|
|
SET_PROPERTY(SOURCE ${COLD_SRCS} APPEND_STRING PROPERTY COMPILE_FLAGS "$<$<NOT:$<CONFIG:Debug>>: -Os >")
|
2021-05-18 14:22:24 +08:00
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
-TARGET_INCLUDE_DIRECTORIES(XNNPACK PUBLIC include)
|
|
|
|
+TARGET_INCLUDE_DIRECTORIES(XNNPACK PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
|
|
|
|
TARGET_INCLUDE_DIRECTORIES(XNNPACK PRIVATE src)
|
2023-01-19 03:06:34 +08:00
|
|
|
TARGET_INCLUDE_DIRECTORIES(all_microkernels PRIVATE include src)
|
|
|
|
TARGET_INCLUDE_DIRECTORIES(packing PRIVATE include src)
|
|
|
|
@@ -6547,7 +6547,7 @@ IF(LIBM)
|
2021-05-18 14:22:24 +08:00
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
# ---[ Configure clog
|
|
|
|
-IF(NOT TARGET clog)
|
|
|
|
+IF(FALSE)
|
|
|
|
IF(NOT XNNPACK_USE_SYSTEM_LIBS)
|
|
|
|
SET(CLOG_BUILD_TESTS OFF CACHE BOOL "")
|
|
|
|
SET(CLOG_RUNTIME_TYPE "${CPUINFO_RUNTIME_TYPE}" CACHE STRING "")
|
2023-01-19 03:06:34 +08:00
|
|
|
@@ -6565,11 +6565,9 @@ IF(NOT TARGET clog)
|
2021-05-18 14:22:24 +08:00
|
|
|
SET_PROPERTY(TARGET clog PROPERTY IMPORTED_LOCATION "${CLOG_LIBRARY}")
|
|
|
|
ENDIF()
|
|
|
|
ENDIF()
|
|
|
|
-TARGET_LINK_LIBRARIES(XNNPACK PRIVATE clog)
|
2023-01-19 03:06:34 +08:00
|
|
|
-TARGET_LINK_LIBRARIES(jit PRIVATE clog)
|
2021-05-18 14:22:24 +08:00
|
|
|
|
|
|
|
# ---[ Configure cpuinfo
|
|
|
|
-IF(NOT TARGET cpuinfo)
|
2023-01-19 03:06:34 +08:00
|
|
|
+IF(false)
|
2021-05-18 14:22:24 +08:00
|
|
|
IF(NOT XNNPACK_USE_SYSTEM_LIBS)
|
|
|
|
SET(CPUINFO_BUILD_TOOLS OFF CACHE BOOL "")
|
|
|
|
SET(CPUINFO_BUILD_UNIT_TESTS OFF CACHE BOOL "")
|
2023-01-19 03:06:34 +08:00
|
|
|
@@ -6587,10 +6585,12 @@ IF(NOT TARGET cpuinfo)
|
2021-05-18 14:22:24 +08:00
|
|
|
SET_PROPERTY(TARGET cpuinfo PROPERTY IMPORTED_LOCATION "${CPUINFO_LIBRARY}")
|
|
|
|
ENDIF()
|
|
|
|
ENDIF()
|
|
|
|
-TARGET_LINK_LIBRARIES(XNNPACK PRIVATE cpuinfo)
|
2022-04-13 03:47:40 +08:00
|
|
|
+find_package(cpuinfo CONFIG REQUIRED)
|
2023-01-19 03:06:34 +08:00
|
|
|
+TARGET_LINK_LIBRARIES(XNNPACK PRIVATE cpuinfo::clog cpuinfo::cpuinfo)
|
|
|
|
+TARGET_LINK_LIBRARIES(jit PRIVATE cpuinfo::clog)
|
2021-05-18 14:22:24 +08:00
|
|
|
|
|
|
|
# ---[ Configure pthreadpool
|
|
|
|
-IF(NOT TARGET pthreadpool)
|
|
|
|
+IF(FALSE)
|
|
|
|
IF(NOT XNNPACK_USE_SYSTEM_LIBS)
|
|
|
|
SET(PTHREADPOOL_BUILD_TESTS OFF CACHE BOOL "")
|
|
|
|
SET(PTHREADPOOL_BUILD_BENCHMARKS OFF CACHE BOOL "")
|
2023-01-19 03:06:34 +08:00
|
|
|
@@ -6607,14 +6607,15 @@ IF(NOT TARGET pthreadpool)
|
|
|
|
SET_PROPERTY(TARGET pthreadpool PROPERTY IMPORTED_LOCATION "${PTHREADPOOL_LIBRARY}")
|
|
|
|
ENDIF()
|
|
|
|
ENDIF()
|
|
|
|
-TARGET_LINK_LIBRARIES(XNNPACK PUBLIC pthreadpool)
|
|
|
|
-TARGET_LINK_LIBRARIES(all_microkernels PRIVATE pthreadpool)
|
|
|
|
-TARGET_LINK_LIBRARIES(indirection PRIVATE pthreadpool)
|
|
|
|
-TARGET_LINK_LIBRARIES(jit PRIVATE pthreadpool)
|
|
|
|
-TARGET_LINK_LIBRARIES(packing PRIVATE pthreadpool)
|
|
|
|
+find_package(unofficial-pthreadpool CONFIG REQUIRED)
|
|
|
|
+target_link_libraries(XNNPACK PUBLIC unofficial::pthreadpool)
|
|
|
|
+target_link_libraries(all_microkernels PRIVATE unofficial::pthreadpool)
|
|
|
|
+target_link_libraries(indirection PRIVATE unofficial::pthreadpool)
|
|
|
|
+target_link_libraries(jit PRIVATE unofficial::pthreadpool)
|
|
|
|
+target_link_libraries(packing PRIVATE unofficial::pthreadpool)
|
2021-05-18 14:22:24 +08:00
|
|
|
|
|
|
|
# ---[ Configure FXdiv
|
|
|
|
-IF(NOT TARGET fxdiv)
|
|
|
|
+IF(FALSE)
|
|
|
|
IF(NOT XNNPACK_USE_SYSTEM_LIBS)
|
|
|
|
SET(FXDIV_BUILD_TESTS OFF CACHE BOOL "")
|
|
|
|
SET(FXDIV_BUILD_BENCHMARKS OFF CACHE BOOL "")
|
2023-01-19 03:06:34 +08:00
|
|
|
@@ -6630,12 +6631,13 @@ IF(NOT TARGET fxdiv)
|
2021-05-18 14:22:24 +08:00
|
|
|
SET_PROPERTY(TARGET fxdiv PROPERTY LINKER_LANGUAGE C)
|
|
|
|
ENDIF()
|
|
|
|
ENDIF()
|
|
|
|
-TARGET_LINK_LIBRARIES(XNNPACK PRIVATE fxdiv)
|
2023-01-19 03:06:34 +08:00
|
|
|
-TARGET_LINK_LIBRARIES(all_microkernels PRIVATE fxdiv)
|
|
|
|
-TARGET_LINK_LIBRARIES(indirection PRIVATE fxdiv)
|
|
|
|
+find_path(FXDIV_INCLUDE_DIRS "fxdiv.h" REQUIRED)
|
2021-05-18 14:22:24 +08:00
|
|
|
+target_include_directories(XNNPACK PRIVATE ${FXDIV_INCLUDE_DIRS})
|
2023-01-19 03:06:34 +08:00
|
|
|
+target_include_directories(all_microkernels PRIVATE ${FXDIV_INCLUDE_DIRS})
|
|
|
|
+target_include_directories(indirection PRIVATE ${FXDIV_INCLUDE_DIRS})
|
2021-05-18 14:22:24 +08:00
|
|
|
|
|
|
|
# ---[ Configure FP16
|
|
|
|
-IF(NOT TARGET fp16)
|
|
|
|
+IF(FALSE)
|
|
|
|
IF(NOT XNNPACK_USE_SYSTEM_LIBS)
|
|
|
|
SET(FP16_BUILD_TESTS OFF CACHE BOOL "")
|
|
|
|
SET(FP16_BUILD_BENCHMARKS OFF CACHE BOOL "")
|
2023-01-19 03:06:34 +08:00
|
|
|
@@ -6651,15 +6653,21 @@ IF(NOT TARGET fp16)
|
2021-05-18 14:22:24 +08:00
|
|
|
SET_PROPERTY(TARGET fp16 PROPERTY LINKER_LANGUAGE C)
|
|
|
|
ENDIF()
|
|
|
|
ENDIF()
|
|
|
|
-TARGET_LINK_LIBRARIES(XNNPACK PRIVATE fp16)
|
2023-01-19 03:06:34 +08:00
|
|
|
-TARGET_LINK_LIBRARIES(all_microkernels PRIVATE fp16)
|
|
|
|
-TARGET_LINK_LIBRARIES(packing PRIVATE fp16)
|
|
|
|
-TARGET_LINK_LIBRARIES(indirection PRIVATE fp16)
|
|
|
|
+find_path(FP16_INCLUDE_DIRS "fp16.h" REQUIRED)
|
2021-05-18 14:22:24 +08:00
|
|
|
+target_include_directories(XNNPACK PRIVATE ${FP16_INCLUDE_DIRS})
|
2023-01-19 03:06:34 +08:00
|
|
|
+target_include_directories(all_microkernels PRIVATE ${FP16_INCLUDE_DIRS})
|
|
|
|
+target_include_directories(packing PRIVATE ${FP16_INCLUDE_DIRS})
|
|
|
|
+target_include_directories(indirection PRIVATE ${FP16_INCLUDE_DIRS})
|
2021-05-18 14:22:24 +08:00
|
|
|
|
|
|
|
INSTALL(TARGETS XNNPACK
|
|
|
|
+ EXPORT xnnpack-config
|
|
|
|
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
|
|
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
|
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
|
|
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
2023-01-19 03:06:34 +08:00
|
|
|
+install(EXPORT xnnpack-config
|
|
|
|
+ NAMESPACE unofficial::
|
2021-05-18 14:22:24 +08:00
|
|
|
+ DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/xnnpack)
|
|
|
|
|
|
|
|
# ---[ XNNPACK unit tests
|
|
|
|
IF(XNNPACK_BUILD_TESTS)
|