mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[caffe2] Minor changes in NNPACK CMake scripts (#6532)
- Tell NNPACK to not link pthreadpool, but only its headers - Remove FindNNPACK.cmake as it is no longer used
This commit is contained in:
1
cmake/External/nnpack.cmake
vendored
1
cmake/External/nnpack.cmake
vendored
@ -61,6 +61,7 @@ if (ANDROID OR IOS OR ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NA
|
||||
if(NOT TARGET nnpack)
|
||||
set(NNPACK_BUILD_TESTS OFF CACHE BOOL "")
|
||||
set(NNPACK_BUILD_BENCHMARKS OFF CACHE BOOL "")
|
||||
set(NNPACK_CUSTOM_THREADPOOL ON CACHE BOOL "")
|
||||
set(NNPACK_LIBRARY_TYPE "static" CACHE STRING "")
|
||||
set(PTHREADPOOL_LIBRARY_TYPE "static" CACHE STRING "")
|
||||
set(CPUINFO_LIBRARY_TYPE "static" CACHE STRING "")
|
||||
|
@ -1,42 +0,0 @@
|
||||
# - Try to find NNPACK
|
||||
#
|
||||
# The following variables are optionally searched for defaults
|
||||
# NNPACK_ROOT_DIR: Base directory where all NNPACK components are found
|
||||
#
|
||||
# The following are set after configuration is done:
|
||||
# NNPACK_FOUND
|
||||
# NNPACK_INCLUDE_DIRS
|
||||
# NNPACK_LIBRARIES
|
||||
# NNPACK_LIBRARYRARY_DIRS
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
set(NNPACK_ROOT_DIR "" CACHE PATH "Folder contains NNPACK")
|
||||
|
||||
find_path(NNPACK_INCLUDE_DIR nnpack.h
|
||||
PATHS ${NNPACK_ROOT_DIR}
|
||||
PATH_SUFFIXES include)
|
||||
|
||||
find_library(NNPACK_LIBRARY nnpack
|
||||
PATHS ${NNPACK_ROOT_DIR}
|
||||
PATH_SUFFIXES lib lib64)
|
||||
|
||||
find_library(PTHREADPOOL_LIBRARY pthreadpool
|
||||
PATHS ${NNPACK_ROOT_DIR}
|
||||
PATH_SUFFIXES lib lib64)
|
||||
|
||||
find_library(CPUINFO_LIBRARY cpuinfo
|
||||
PATHS ${NNPACK_ROOT_DIR}
|
||||
PATH_SUFFIXES lib lib64)
|
||||
|
||||
find_package_handle_standard_args(NNPACK DEFAULT_MSG NNPACK_INCLUDE_DIR NNPACK_LIBRARY PTHREADPOOL_LIBRARY CPUINFO_LIBRARY)
|
||||
|
||||
if(NNPACK_FOUND)
|
||||
set(NNPACK_INCLUDE_DIRS ${NNPACK_INCLUDE_DIR})
|
||||
set(NNPACK_LIBRARIES ${NNPACK_LIBRARY} ${PTHREADPOOL_LIBRARY} ${CPUINFO_LIBRARY})
|
||||
message(STATUS "Found NNPACK (include: ${NNPACK_INCLUDE_DIR}, library: ${NNPACK_LIBRARY})")
|
||||
message(STATUS "Found PTHREADPOOL (library: ${PTHREADPOOL_LIBRARY})")
|
||||
message(STATUS "Found CPUINFO (library: ${CPUINFO_LIBRARY})")
|
||||
mark_as_advanced(NNPACK_ROOT_DIR NNPACK_LIBRARY_RELEASE NNPACK_LIBRARY_DEBUG
|
||||
NNPACK_LIBRARY NNPACK_INCLUDE_DIR)
|
||||
endif()
|
Reference in New Issue
Block a user