mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
Fixing pthreadpool symbol conflict issue. (#33869)
Summary: Mainly renaming pthread_create of C2, the only one referred internally in NNPACK, that is conflicting, to pthread_create_c2. Removed 2 other conflicting symbols that are not used internally at all. Pointing XNNPACK to original repo instead of the fork. Copy pasted the new interface and implementation to caff2/utils/threadpool, so that for internal builds we compile against this. When threadpool is unified this will be removed. Pull Request resolved: https://github.com/pytorch/pytorch/pull/33869 Differential Revision: D20140580 Pulled By: kimishpatel fbshipit-source-id: de70df0af9c7d6bc065e85ede0e1c4dd6a9e6be3
This commit is contained in:
committed by
Facebook Github Bot
parent
85b1c45a45
commit
0e52627358
@ -50,6 +50,21 @@ endif()
|
||||
# Note: the folders that are being commented out have not been properly
|
||||
# addressed yet.
|
||||
|
||||
# For pthreadpool_new_if_impl. TODO: Remove when threadpools are unitied.
|
||||
if (NOT MSVC)
|
||||
IF(NOT TARGET fxdiv)
|
||||
SET(FXDIV_BUILD_TESTS OFF CACHE BOOL "")
|
||||
SET(FXDIV_BUILD_BENCHMARKS OFF CACHE BOOL "")
|
||||
ADD_SUBDIRECTORY(
|
||||
"${FXDIV_SOURCE_DIR}"
|
||||
"${CMAKE_BINARY_DIR}/FXdiv")
|
||||
ENDIF()
|
||||
if (NOT (INTERN_BUILD_MOBILE AND NOT BUILD_CAFFE2_MOBILE))
|
||||
set_source_files_properties(
|
||||
utils/threadpool/pthreadpool_new_if_impl.c PROPERTIES COMPILE_FLAGS -fno-openmp)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_subdirectory(core)
|
||||
add_subdirectory(serialize)
|
||||
add_subdirectory(utils)
|
||||
@ -677,6 +692,9 @@ ELSEIF(USE_CUDA)
|
||||
ENDIF()
|
||||
|
||||
|
||||
if (NOT MSVC)
|
||||
TARGET_LINK_LIBRARIES(torch_cpu PRIVATE fxdiv)
|
||||
endif()
|
||||
|
||||
# ==========================================================
|
||||
# formerly-libtorch flags
|
||||
|
Reference in New Issue
Block a user