Skip to content

Commit 37c4b19

Browse files
mcr229pytorchmergebot
authored andcommitted
make sure ukernel prod is everywhere XNNPACK is (pytorch#142086)
Just double checking that ukernel prod (which should be linked with XNNPACK) is in all the places XNNPACK is Pull Request resolved: pytorch#142086 Approved by: https://github.com/kirklandsign
1 parent 18ef3a0 commit 37c4b19

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

cmake/Dependencies.cmake

+7-4
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ if(USE_XNNPACK AND NOT USE_SYSTEM_XNNPACK)
500500
set(XNNPACK_INCLUDE_DIR "${XNNPACK_SOURCE_DIR}/include" CACHE STRING "XNNPACK include directory")
501501
endif()
502502

503-
if(NOT TARGET XNNPACK)
503+
if(NOT TARGET XNNPACK OR NOT TARGET microkernels-prod)
504504
set(XNNPACK_LIBRARY_TYPE "static" CACHE STRING "")
505505
set(XNNPACK_BUILD_BENCHMARKS OFF CACHE BOOL "")
506506
set(XNNPACK_BUILD_TESTS OFF CACHE BOOL "")
@@ -548,16 +548,19 @@ if(USE_XNNPACK AND NOT USE_SYSTEM_XNNPACK)
548548
endif()
549549

550550
include_directories(SYSTEM ${XNNPACK_INCLUDE_DIR})
551-
list(APPEND Caffe2_DEPENDENCY_LIBS XNNPACK)
551+
list(APPEND Caffe2_DEPENDENCY_LIBS XNNPACK microkernels-prod)
552552
elseif(NOT TARGET XNNPACK AND USE_SYSTEM_XNNPACK)
553553
add_library(XNNPACK SHARED IMPORTED)
554+
add_library(microkernels-prod SHARED IMPORTED)
554555
find_library(XNNPACK_LIBRARY XNNPACK)
556+
find_library(microkernels-prod_LIBRARY microkernels-prod)
555557
set_property(TARGET XNNPACK PROPERTY IMPORTED_LOCATION "${XNNPACK_LIBRARY}")
556-
if(NOT XNNPACK_LIBRARY)
558+
set_property(TARGET microkernels-prod PROPERTY IMPORTED_LOCATION "${microkernels-prod_LIBRARY}")
559+
if(NOT XNNPACK_LIBRARY or NOT microkernels-prod_LIBRARY)
557560
message(FATAL_ERROR "Cannot find XNNPACK")
558561
endif()
559562
message("-- Found XNNPACK: ${XNNPACK_LIBRARY}")
560-
list(APPEND Caffe2_DEPENDENCY_LIBS XNNPACK)
563+
list(APPEND Caffe2_DEPENDENCY_LIBS XNNPACK microkernels-prod)
561564
endif()
562565

563566
# ---[ Vulkan deps

0 commit comments

Comments
 (0)