mirror of
https://github.com/saymrwulf/pytorch.git
synced 2026-05-14 20:57:59 +00:00
Restore TBB module (#20454)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/20454 ghimport-source-id: 14aca1dedbe647d41e55e7538a6b7eeab0fc4384 Differential Revision: D15326062 Pulled By: ilia-cher fbshipit-source-id: 02b005a679b10dc7a264978e87a8d2bb98ab972f
This commit is contained in:
parent
82aecfad6a
commit
580eab6562
17 changed files with 530 additions and 31 deletions
4
.gitmodules
vendored
4
.gitmodules
vendored
|
|
@ -110,3 +110,7 @@
|
|||
ignore = dirty
|
||||
path = third_party/foxi
|
||||
url = https://github.com/houseroad/foxi.git
|
||||
[submodule "third_party/tbb"]
|
||||
path = third_party/tbb
|
||||
url = https://github.com/01org/tbb
|
||||
branch = tbb_2018
|
||||
|
|
|
|||
|
|
@ -137,6 +137,7 @@ cmake_dependent_option(
|
|||
cmake_dependent_option(
|
||||
USE_GLOO_IBVERBS "Use Gloo IB verbs for distributed. Only available if USE_GLOO is on." OFF
|
||||
"USE_GLOO" OFF)
|
||||
option(USE_TBB "Use TBB" OFF)
|
||||
|
||||
# Used when building Caffe2 through setup.py
|
||||
option(BUILDING_WITH_TORCH_LIBS "Tell cmake if Caffe2 is being built alongside torch libs" OFF)
|
||||
|
|
|
|||
|
|
@ -116,6 +116,12 @@ IF(NOT AT_LINK_STYLE)
|
|||
SET(AT_LINK_STYLE SHARED)
|
||||
ENDIF()
|
||||
|
||||
IF (USE_TBB)
|
||||
message("ATen is compiled with TBB (${TBB_ROOT_DIR})")
|
||||
list(APPEND ATen_CPU_INCLUDE ${TBB_ROOT_DIR}/include)
|
||||
list(APPEND ATen_CPU_DEPENDENCY_LIBS tbb)
|
||||
ENDIF()
|
||||
|
||||
IF(BLAS_FOUND)
|
||||
IF ($ENV{TH_BINARY_BUILD})
|
||||
MESSAGE(STATUS "TH_BINARY_BUILD detected. Enabling special linkage.")
|
||||
|
|
|
|||
376
aten/src/ATen/cpu/tbb/CMakeLists.txt
Normal file
376
aten/src/ATen/cpu/tbb/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,376 @@
|
|||
# Based on https://github.com/wjakob/tbb/blob/master/CMakeLists.txt
|
||||
# All credit goes to Wenzel Jakob!
|
||||
|
||||
cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR)
|
||||
project (tbb CXX)
|
||||
|
||||
include(CheckCXXCompilerFlag)
|
||||
include(CheckCXXSourceRuns)
|
||||
|
||||
if(POLICY CMP0058)
|
||||
cmake_policy(SET CMP0058 NEW)
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||
message(STATUS "Setting build type to 'Release' as none was specified.")
|
||||
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
|
||||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
|
||||
"MinSizeRel" "RelWithDebInfo")
|
||||
endif()
|
||||
|
||||
if(NOT TBB_ROOT_DIR)
|
||||
set(TBB_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
endif()
|
||||
if(NOT TBB_INSTALL_RUNTIME_DIR)
|
||||
set(TBB_INSTALL_RUNTIME_DIR bin)
|
||||
endif()
|
||||
if(NOT TBB_INSTALL_LIBRARY_DIR)
|
||||
set(TBB_INSTALL_LIBRARY_DIR lib)
|
||||
endif()
|
||||
if(NOT TBB_INSTALL_ARCHIVE_DIR)
|
||||
set(TBB_INSTALL_ARCHIVE_DIR lib)
|
||||
endif()
|
||||
if(NOT TBB_INSTALL_INCLUDE_DIR)
|
||||
set(TBB_INSTALL_INCLUDE_DIR "${TBB_ROOT_DIR}/include")
|
||||
endif()
|
||||
|
||||
set(TBB_INCLUDES
|
||||
"${TBB_ROOT_DIR}/include"
|
||||
"${TBB_ROOT_DIR}/src"
|
||||
"${TBB_ROOT_DIR}/src/rml/include"
|
||||
${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
option(TBB_BUILD_SHARED "Build TBB shared library" ON)
|
||||
option(TBB_BUILD_STATIC "Build TBB static library" ON)
|
||||
option(TBB_BUILD_TBBMALLOC "Build TBB malloc library" ON)
|
||||
option(TBB_BUILD_TBBMALLOC_PROXY "Build TBB malloc proxy library" ON)
|
||||
option(TBB_BUILD_TESTS "Build TBB tests and enable testing infrastructure" ON)
|
||||
option(TBB_CI_BUILD "Is this a continuous integration build?" OFF)
|
||||
|
||||
if(APPLE)
|
||||
set(CMAKE_MACOSX_RPATH ON)
|
||||
endif()
|
||||
|
||||
file(GLOB tbb_src "${TBB_ROOT_DIR}/src/tbb/*.cpp" "${TBB_ROOT_DIR}/src/old/*.cpp")
|
||||
list(APPEND tbb_src ${TBB_ROOT_DIR}/src/rml/client/rml_tbb.cpp)
|
||||
file(GLOB to_remove "${TBB_ROOT_DIR}/src/old/test*.cpp")
|
||||
if (NOT "${to_remove}" STREQUAL "")
|
||||
list(REMOVE_ITEM tbb_src ${to_remove})
|
||||
endif()
|
||||
|
||||
set(tbbmalloc_static_src
|
||||
src/tbbmalloc/backend.cpp
|
||||
src/tbbmalloc/large_objects.cpp
|
||||
src/tbbmalloc/backref.cpp
|
||||
src/tbbmalloc/tbbmalloc.cpp
|
||||
src/tbbmalloc/frontend.cpp
|
||||
src/tbb/itt_notify.cpp)
|
||||
|
||||
set(tbbmalloc_src ${tbbmalloc_static_src})
|
||||
|
||||
set(tbbmalloc_proxy_src
|
||||
src/tbbmalloc/proxy.cpp
|
||||
src/tbbmalloc/tbb_function_replacement.cpp)
|
||||
|
||||
if (CMAKE_SYSTEM_PROCESSOR MATCHES "(i386|x86_64)")
|
||||
if (NOT APPLE AND NOT MINGW)
|
||||
add_definitions(-DDO_ITT_NOTIFY)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (APPLE)
|
||||
# Disable annoying "has no symbols" warnings
|
||||
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
set(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
|
||||
set(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
|
||||
endif()
|
||||
|
||||
macro(CHECK_CXX_COMPILER_AND_LINKER_FLAGS _RESULT _CXX_FLAGS _LINKER_FLAGS)
|
||||
set(CMAKE_REQUIRED_FLAGS ${_CXX_FLAGS})
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${_LINKER_FLAGS})
|
||||
set(CMAKE_REQUIRED_QUIET TRUE)
|
||||
check_cxx_source_runs("#include <iostream>\nint main(int argc, char **argv) { std::cout << \"test\"; return 0; }" ${_RESULT})
|
||||
set(CMAKE_REQUIRED_FLAGS "")
|
||||
set(CMAKE_REQUIRED_LIBRARIES "")
|
||||
endmacro()
|
||||
|
||||
# Prefer libc++ in conjunction with Clang
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
if (CMAKE_CXX_FLAGS MATCHES "-stdlib=libc\\+\\+")
|
||||
message(STATUS "TBB: using libc++.")
|
||||
else()
|
||||
CHECK_CXX_COMPILER_AND_LINKER_FLAGS(HAS_LIBCPP "-stdlib=libc++" "-stdlib=libc++")
|
||||
if (HAS_LIBCPP)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -D_LIBCPP_VERSION")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -stdlib=libc++")
|
||||
message(STATUS "TBB: using libc++.")
|
||||
else()
|
||||
message(STATUS "TBB: NOT using libc++.")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (UNIX)
|
||||
add_definitions (-DUSE_PTHREAD)
|
||||
|
||||
check_cxx_compiler_flag ("-std=c++11" SUPPORTS_STDCXX11)
|
||||
if (SUPPORTS_STDCXX11)
|
||||
set (CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
|
||||
endif ()
|
||||
|
||||
check_cxx_compiler_flag ("-mrtm -Werror" SUPPORTS_MRTM)
|
||||
if (SUPPORTS_MRTM)
|
||||
set (CMAKE_CXX_FLAGS "-mrtm ${CMAKE_CXX_FLAGS}")
|
||||
endif ()
|
||||
|
||||
elseif(WIN32)
|
||||
if (MSVC)
|
||||
cmake_minimum_required (VERSION 3.1)
|
||||
enable_language(ASM_MASM)
|
||||
set(CMAKE_CXX_FLAGS "/GS- /Zc:wchar_t /Zc:forScope /DUSE_WINTHREAD ${CMAKE_CXX_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS "/D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0600 ${CMAKE_CXX_FLAGS}")
|
||||
check_cxx_compiler_flag ("/volatile:iso" SUPPORTS_VOLATILE_FLAG)
|
||||
if (SUPPORTS_VOLATILE_FLAG)
|
||||
set(CMAKE_CXX_FLAGS "/volatile:iso ${CMAKE_CXX_FLAGS}")
|
||||
endif ()
|
||||
set(CMAKE_CXX_FLAGS "/wd4267 /wd4800 /wd4146 /wd4244 /wd4577 /wd4018 ${CMAKE_CXX_FLAGS}")
|
||||
if (NOT CMAKE_SIZEOF_VOID_P)
|
||||
message(FATAL_ERROR "'CMAKE_SIZEOF_VOID_P' is undefined. Please delete your build directory and rerun CMake again!")
|
||||
endif()
|
||||
|
||||
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
list(APPEND tbb_src "${TBB_ROOT_DIR}/src/tbb/intel64-masm/atomic_support.asm")
|
||||
list(APPEND tbb_src "${TBB_ROOT_DIR}/src/tbb/intel64-masm/itsx.asm")
|
||||
list(APPEND tbb_src "${TBB_ROOT_DIR}/src/tbb/intel64-masm/intel64_misc.asm")
|
||||
list(APPEND tbbmalloc_src "${TBB_ROOT_DIR}/src/tbb/intel64-masm/atomic_support.asm")
|
||||
set(CMAKE_ASM_MASM_FLAGS "/DEM64T=1 ${CMAKE_ASM_MASM_FLAGS}")
|
||||
else()
|
||||
list(APPEND tbb_src "${TBB_ROOT_DIR}/src/tbb/ia32-masm/atomic_support.asm"
|
||||
"${TBB_ROOT_DIR}/src/tbb/ia32-masm/itsx.asm src/tbb/ia32-masm/lock_byte.asm")
|
||||
# Enable SAFESEH feature for assembly (x86 builds only).
|
||||
set(CMAKE_ASM_MASM_FLAGS "/safeseh ${CMAKE_ASM_MASM_FLAGS}")
|
||||
endif()
|
||||
elseif (MINGW)
|
||||
add_definitions(-DUSE_WINTHREAD)
|
||||
add_definitions(-D_WIN32_WINNT=0x0502)
|
||||
set(CMAKE_CXX_FLAGS "-mthreads ${CMAKE_CXX_FLAGS}")
|
||||
endif ()
|
||||
endif()
|
||||
|
||||
if (MSVC)
|
||||
set(ENABLE_RTTI "/EHsc /GR ")
|
||||
set(DISABLE_RTTI "/EHs- /GR- ")
|
||||
elseif (UNIX)
|
||||
set(ENABLE_RTTI "-frtti -fexceptions ")
|
||||
set(DISABLE_RTTI "-fno-rtti -fno-exceptions ")
|
||||
endif ()
|
||||
|
||||
##--------
|
||||
# - Added TBB_USE_GLIBCXX_VERSION macro to specify the version of GNU
|
||||
# libstdc++ when it cannot be properly recognized, e.g. when used
|
||||
# with Clang on Linux* OS. Inspired by a contribution from David A.
|
||||
if (NOT TBB_USE_GLIBCXX_VERSION AND UNIX AND NOT APPLE)
|
||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
# using Clang
|
||||
string(REPLACE "." "0" TBB_USE_GLIBCXX_VERSION ${CMAKE_CXX_COMPILER_VERSION})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (TBB_USE_GLIBCXX_VERSION)
|
||||
add_definitions(-DTBB_USE_GLIBCXX_VERSION=${TBB_USE_GLIBCXX_VERSION})
|
||||
endif()
|
||||
|
||||
##-------
|
||||
|
||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
check_cxx_compiler_flag ("-flifetime-dse=1" SUPPORTS_FLIFETIME)
|
||||
if (SUPPORTS_FLIFETIME)
|
||||
add_definitions(-flifetime-dse=1)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Linker export definitions
|
||||
if (APPLE)
|
||||
set (ARCH_PREFIX "mac")
|
||||
elseif(WIN32)
|
||||
set (ARCH_PREFIX "win")
|
||||
else()
|
||||
set (ARCH_PREFIX "lin")
|
||||
endif()
|
||||
|
||||
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(ARCH_PREFIX "${ARCH_PREFIX}64")
|
||||
else()
|
||||
set(ARCH_PREFIX "${ARCH_PREFIX}32")
|
||||
endif()
|
||||
|
||||
if (MINGW)
|
||||
set (ARCH_PREFIX "${ARCH_PREFIX}-gcc")
|
||||
# there's no win32-gcc-tbb-export.def, use lin32-tbb-export.def
|
||||
execute_process (COMMAND ${CMAKE_COMMAND} -E copy ${TBB_ROOT_DIR}/src/tbb/lin32-tbb-export.def ${TBB_ROOT_DIR}/src/tbb/win32-gcc-tbb-export.def)
|
||||
endif()
|
||||
|
||||
if (MSVC)
|
||||
add_custom_command(OUTPUT tbb.def
|
||||
COMMAND ${CMAKE_CXX_COMPILER} /TC /EP ${TBB_ROOT_DIR}/src/tbb/${ARCH_PREFIX}-tbb-export.def -I ${TBB_ROOT_DIR}/include > tbb.def
|
||||
MAIN_DEPENDENCY ${TBB_ROOT_DIR}/src/tbb/${ARCH_PREFIX}-tbb-export.def
|
||||
COMMENT "Preprocessing tbb.def"
|
||||
)
|
||||
|
||||
add_custom_command(OUTPUT tbbmalloc.def
|
||||
COMMAND ${CMAKE_CXX_COMPILER} /TC /EP ${TBB_ROOT_DIR}/src/tbbmalloc/${ARCH_PREFIX}-tbbmalloc-export.def -I ${TBB_ROOT_DIR}/include > tbbmalloc.def
|
||||
MAIN_DEPENDENCY ${TBB_ROOT_DIR}/src/tbbmalloc/${ARCH_PREFIX}-tbbmalloc-export.def
|
||||
COMMENT "Preprocessing tbbmalloc.def"
|
||||
)
|
||||
else()
|
||||
add_custom_command(OUTPUT tbb.def
|
||||
COMMAND ${CMAKE_CXX_COMPILER} -xc++ -E ${TBB_ROOT_DIR}/src/tbb/${ARCH_PREFIX}-tbb-export.def -I ${TBB_ROOT_DIR}/include -o tbb.def
|
||||
MAIN_DEPENDENCY ${TBB_ROOT_DIR}/src/tbb/${ARCH_PREFIX}-tbb-export.def
|
||||
COMMENT "Preprocessing tbb.def"
|
||||
)
|
||||
|
||||
add_custom_command(OUTPUT tbbmalloc.def
|
||||
COMMAND ${CMAKE_CXX_COMPILER} -xc++ -E ${TBB_ROOT_DIR}/src/tbbmalloc/${ARCH_PREFIX}-tbbmalloc-export.def -I ${TBB_ROOT_DIR}/include -o tbbmalloc.def
|
||||
MAIN_DEPENDENCY ${TBB_ROOT_DIR}/src/tbbmalloc/${ARCH_PREFIX}-tbbmalloc-export.def
|
||||
COMMENT "Preprocessing tbbmalloc.def"
|
||||
)
|
||||
endif()
|
||||
|
||||
add_custom_target(tbb_def_files DEPENDS tbb.def tbbmalloc.def)
|
||||
|
||||
# TBB library
|
||||
if (TBB_BUILD_STATIC)
|
||||
add_library(tbb_static STATIC ${tbb_src})
|
||||
target_include_directories(tbb_static PRIVATE ${TBB_INCLUDES})
|
||||
set_property(TARGET tbb_static APPEND PROPERTY COMPILE_DEFINITIONS "__TBB_BUILD=1")
|
||||
set_property(TARGET tbb_static APPEND_STRING PROPERTY COMPILE_FLAGS ${ENABLE_RTTI})
|
||||
install(TARGETS tbb_static ARCHIVE DESTINATION ${TBB_INSTALL_ARCHIVE_DIR})
|
||||
if (MSVC)
|
||||
target_compile_definitions(tbb_static PUBLIC __TBB_NO_IMPLICIT_LINKAGE=1)
|
||||
endif()
|
||||
|
||||
if (UNIX AND NOT APPLE)
|
||||
target_link_libraries(tbb_static PUBLIC pthread dl)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (TBB_BUILD_SHARED)
|
||||
add_library(tbb SHARED ${tbb_src})
|
||||
target_include_directories(tbb PRIVATE ${TBB_INCLUDES})
|
||||
set_property(TARGET tbb APPEND PROPERTY COMPILE_DEFINITIONS "__TBB_BUILD=1")
|
||||
set_property(TARGET tbb APPEND_STRING PROPERTY COMPILE_FLAGS ${ENABLE_RTTI})
|
||||
add_dependencies(tbb tbb_def_files)
|
||||
|
||||
if (APPLE)
|
||||
set_property(TARGET tbb APPEND PROPERTY LINK_FLAGS "-Wl,-exported_symbols_list,\"${CMAKE_CURRENT_BINARY_DIR}/tbb.def\"")
|
||||
elseif (MSVC)
|
||||
set_property(TARGET tbb APPEND PROPERTY LINK_FLAGS "/DEF:\"${CMAKE_CURRENT_BINARY_DIR}/tbb.def\"")
|
||||
else ()
|
||||
set_property(TARGET tbb APPEND PROPERTY LINK_FLAGS "-Wl,-version-script,\"${CMAKE_CURRENT_BINARY_DIR}/tbb.def\"")
|
||||
endif()
|
||||
|
||||
install(TARGETS tbb
|
||||
LIBRARY DESTINATION ${TBB_INSTALL_LIBRARY_DIR}
|
||||
ARCHIVE DESTINATION ${TBB_INSTALL_ARCHIVE_DIR}
|
||||
RUNTIME DESTINATION ${TBB_INSTALL_RUNTIME_DIR})
|
||||
if (UNIX AND NOT APPLE)
|
||||
target_link_libraries(tbb PUBLIC pthread dl)
|
||||
endif()
|
||||
if (MSVC)
|
||||
target_compile_definitions(tbb PUBLIC __TBB_NO_IMPLICIT_LINKAGE=1)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
# Quench a warning on GCC
|
||||
set_source_files_properties(${TBB_ROOT_DIR}/src/tbb/governor.cpp COMPILE_FLAGS "-Wno-missing-field-initializers ")
|
||||
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
# Quench a warning on Clang
|
||||
set_source_files_properties(${TBB_ROOT_DIR}/src/tbb/itt_notify.cpp COMPILE_FLAGS "-Wno-varargs ")
|
||||
elseif(MSVC)
|
||||
# Quench a warning on MSVC
|
||||
set_source_files_properties(${TBB_ROOT_DIR}/src/tbb/scheduler.cpp COMPILE_FLAGS "/wd4458 ")
|
||||
endif()
|
||||
|
||||
if(TBB_BUILD_TBBMALLOC)
|
||||
# TBB malloc library
|
||||
if (TBB_BUILD_STATIC)
|
||||
add_library(tbbmalloc_static STATIC ${tbbmalloc_static_src})
|
||||
target_include_directories(tbbmalloc_static PRIVATE ${TBB_INCLUDES})
|
||||
set_property(TARGET tbbmalloc_static APPEND PROPERTY COMPILE_DEFINITIONS "__TBBMALLOC_BUILD=1")
|
||||
set_property(TARGET tbbmalloc_static APPEND_STRING PROPERTY COMPILE_FLAGS ${DISABLE_RTTI})
|
||||
if (MSVC)
|
||||
target_compile_definitions(tbbmalloc_static PUBLIC __TBB_NO_IMPLICIT_LINKAGE=1 __TBBMALLOC_NO_IMPLICIT_LINKAGE=1)
|
||||
endif()
|
||||
install(TARGETS tbbmalloc_static ARCHIVE DESTINATION ${TBB_INSTALL_ARCHIVE_DIR})
|
||||
endif()
|
||||
|
||||
if (TBB_BUILD_SHARED)
|
||||
add_library(tbbmalloc SHARED ${tbbmalloc_src})
|
||||
target_include_directories(tbbmalloc PRIVATE ${TBB_INCLUDES})
|
||||
set_property(TARGET tbbmalloc APPEND PROPERTY COMPILE_DEFINITIONS "__TBBMALLOC_BUILD=1")
|
||||
set_property(TARGET tbbmalloc APPEND_STRING PROPERTY COMPILE_FLAGS ${DISABLE_RTTI})
|
||||
add_dependencies(tbbmalloc tbb_def_files)
|
||||
if (APPLE)
|
||||
set_property(TARGET tbbmalloc APPEND PROPERTY LINK_FLAGS "-Wl,-exported_symbols_list,\"${CMAKE_CURRENT_BINARY_DIR}/tbbmalloc.def\"")
|
||||
elseif (MSVC)
|
||||
set_property(TARGET tbbmalloc APPEND PROPERTY LINK_FLAGS "/DEF:\"${CMAKE_CURRENT_BINARY_DIR}/tbbmalloc.def\"")
|
||||
else ()
|
||||
set_property(TARGET tbbmalloc APPEND PROPERTY LINK_FLAGS "-Wl,-version-script,\"${CMAKE_CURRENT_BINARY_DIR}/tbbmalloc.def\"")
|
||||
endif()
|
||||
if (MSVC)
|
||||
target_compile_definitions(tbbmalloc PUBLIC __TBB_NO_IMPLICIT_LINKAGE=1 __TBBMALLOC_NO_IMPLICIT_LINKAGE=1)
|
||||
endif()
|
||||
install(TARGETS tbbmalloc
|
||||
LIBRARY DESTINATION ${TBB_INSTALL_LIBRARY_DIR}
|
||||
ARCHIVE DESTINATION ${TBB_INSTALL_ARCHIVE_DIR}
|
||||
RUNTIME DESTINATION ${TBB_INSTALL_RUNTIME_DIR})
|
||||
if (UNIX AND NOT APPLE)
|
||||
target_link_libraries(tbbmalloc PUBLIC pthread dl)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(TBB_BUILD_TBBMALLOC_PROXY)
|
||||
# TBB malloc proxy library
|
||||
if (TBB_BUILD_STATIC)
|
||||
add_library(tbbmalloc_proxy_static STATIC ${tbbmalloc_proxy_src})
|
||||
set_property(TARGET tbbmalloc_proxy_static APPEND PROPERTY COMPILE_DEFINITIONS "__TBBMALLOC_BUILD=1")
|
||||
set_property(TARGET tbbmalloc_proxy_static APPEND_STRING PROPERTY COMPILE_FLAGS ${DISABLE_RTTI})
|
||||
install(TARGETS tbbmalloc_proxy_static ARCHIVE DESTINATION ${TBB_INSTALL_ARCHIVE_DIR})
|
||||
endif()
|
||||
|
||||
if (TBB_BUILD_SHARED)
|
||||
add_library(tbbmalloc_proxy SHARED ${tbbmalloc_proxy_src})
|
||||
set_property(TARGET tbbmalloc_proxy APPEND PROPERTY COMPILE_DEFINITIONS "__TBBMALLOC_BUILD=1")
|
||||
set_property(TARGET tbbmalloc_proxy APPEND_STRING PROPERTY COMPILE_FLAGS ${DISABLE_RTTI})
|
||||
target_link_libraries(tbbmalloc_proxy PUBLIC tbbmalloc)
|
||||
install(TARGETS tbbmalloc_proxy
|
||||
LIBRARY DESTINATION ${TBB_INSTALL_LIBRARY_DIR}
|
||||
ARCHIVE DESTINATION ${TBB_INSTALL_ARCHIVE_DIR}
|
||||
RUNTIME DESTINATION ${TBB_INSTALL_RUNTIME_DIR})
|
||||
if (UNIX AND NOT APPLE)
|
||||
target_link_libraries(tbbmalloc_proxy PUBLIC pthread dl)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
install(DIRECTORY "${TBB_ROOT_DIR}/include/tbb" DESTINATION ${TBB_INSTALL_INCLUDE_DIR})
|
||||
|
||||
# version_string.ver
|
||||
if (UNIX)
|
||||
execute_process (COMMAND date "+%a, %d %b %Y %H:%M:%S %z"
|
||||
OUTPUT_VARIABLE _configure_date
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
elseif (WIN32)
|
||||
execute_process (COMMAND cmd " /C date /T"
|
||||
OUTPUT_VARIABLE _configure_date
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
else ()
|
||||
set (_configure_date "Unknown")
|
||||
endif()
|
||||
include_directories (${CMAKE_BINARY_DIR})
|
||||
configure_file (extra/version_string.ver.in version_string.ver @ONLY)
|
||||
11
aten/src/ATen/cpu/tbb/extra/version_string.ver.in
Normal file
11
aten/src/ATen/cpu/tbb/extra/version_string.ver.in
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
#define __TBB_VERSION_STRINGS(N) \
|
||||
#N": BUILD_HOST @CMAKE_SYSTEM_NAME@" ENDL \
|
||||
#N": BUILD_OS @CMAKE_SYSTEM@" ENDL \
|
||||
#N": BUILD_KERNEL @CMAKE_SYSTEM_VERSION@" ENDL \
|
||||
#N": BUILD_GCC @CMAKE_CXX_COMPILER_ID@" ENDL \
|
||||
#N": BUILD_LIBC Unknown" ENDL \
|
||||
#N": BUILD_LD Unknown" ENDL \
|
||||
#N": BUILD_TARGET Unknown" ENDL \
|
||||
#N": BUILD_COMMAND Unknown" ENDL
|
||||
|
||||
#define __TBB_DATETIME "@_configure_date@"
|
||||
|
|
@ -673,6 +673,13 @@ if (NOT INTERN_BUILD_MOBILE)
|
|||
${CMAKE_CURRENT_BINARY_DIR}/../aten/src
|
||||
${CMAKE_CURRENT_BINARY_DIR}/../aten/src/ATen
|
||||
${CMAKE_BINARY_DIR}/aten/src)
|
||||
|
||||
IF (USE_TBB)
|
||||
list(APPEND ATen_CPU_INCLUDE ${TBB_ROOT_DIR}/include)
|
||||
target_link_libraries(caffe2 PUBLIC tbb)
|
||||
ENDIF()
|
||||
|
||||
|
||||
target_include_directories(caffe2 PRIVATE ${ATen_CPU_INCLUDE})
|
||||
|
||||
target_include_directories(caffe2 PRIVATE
|
||||
|
|
@ -964,6 +971,10 @@ endif()
|
|||
|
||||
caffe2_interface_library(caffe2 caffe2_library)
|
||||
list(APPEND Caffe2_MAIN_LIBS caffe2_library)
|
||||
if (USE_TBB)
|
||||
list(APPEND Caffe2_MAIN_LIB tbb)
|
||||
endif()
|
||||
|
||||
# Install PDB files for MSVC builds
|
||||
if (MSVC AND BUILD_SHARED_LIBS)
|
||||
install(FILES $<TARGET_PDB_FILE:caffe2> DESTINATION lib OPTIONAL)
|
||||
|
|
|
|||
|
|
@ -73,6 +73,27 @@ else()
|
|||
"Cannot find threading library. Caffe2 requires Threads to compile.")
|
||||
endif()
|
||||
|
||||
if (USE_TBB)
|
||||
message(STATUS "Compiling TBB from source")
|
||||
# Unset our restrictive C++ flags here and reset them later.
|
||||
# Remove this once we use proper target_compile_options.
|
||||
set(OLD_CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
|
||||
set(CMAKE_CXX_FLAGS)
|
||||
|
||||
set(TBB_ROOT_DIR "${CMAKE_SOURCE_DIR}/third_party/tbb")
|
||||
set(TBB_BUILD_STATIC OFF CACHE BOOL " " FORCE)
|
||||
set(TBB_BUILD_SHARED ON CACHE BOOL " " FORCE)
|
||||
set(TBB_BUILD_TBBMALLOC OFF CACHE BOOL " " FORCE)
|
||||
set(TBB_BUILD_TBBMALLOC_PROXY OFF CACHE BOOL " " FORCE)
|
||||
set(TBB_BUILD_TESTS OFF CACHE BOOL " " FORCE)
|
||||
add_subdirectory(${CMAKE_SOURCE_DIR}/aten/src/ATen/cpu/tbb)
|
||||
set_property(TARGET tbb tbb_def_files PROPERTY FOLDER "dependencies")
|
||||
|
||||
install(TARGETS tbb EXPORT Caffe2Targets DESTINATION lib)
|
||||
|
||||
set(CMAKE_CXX_FLAGS ${OLD_CMAKE_CXX_FLAGS})
|
||||
endif()
|
||||
|
||||
# ---[ protobuf
|
||||
if(CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO)
|
||||
if(USE_LITE_PROTO)
|
||||
|
|
|
|||
|
|
@ -36,6 +36,16 @@ SET(INTEL_MKL_DIR "/opt/intel/mkl" CACHE STRING
|
|||
"Root directory of the Intel MKL (standalone)")
|
||||
SET(INTEL_MKL_SEQUENTIAL OFF CACHE BOOL
|
||||
"Force using the sequential (non threaded) libraries")
|
||||
SET(INTEL_MKL_TBB OFF CACHE BOOL
|
||||
"Force using TBB library")
|
||||
|
||||
IF (INTEL_MKL_TBB)
|
||||
IF (USE_TBB)
|
||||
message(STATUS "MKL is using TBB")
|
||||
ELSE()
|
||||
message(FATAL_ERROR "INTEL_MKL_TBB is set to true but TBB is not used")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
# Checks
|
||||
CHECK_TYPE_SIZE("void*" SIZE_OF_VOIDP)
|
||||
|
|
@ -49,16 +59,26 @@ ELSE ("${SIZE_OF_VOIDP}" EQUAL 8)
|
|||
SET(mkl64s)
|
||||
ENDIF ("${SIZE_OF_VOIDP}" EQUAL 8)
|
||||
IF(CMAKE_COMPILER_IS_GNUCC)
|
||||
SET(mklthreads "mkl_gnu_thread" "mkl_intel_thread")
|
||||
IF (INTEL_MKL_TBB)
|
||||
SET(mklthreads "mkl_tbb_thread")
|
||||
SET(mklrtls "tbb")
|
||||
ELSE()
|
||||
SET(mklthreads "mkl_gnu_thread" "mkl_intel_thread")
|
||||
SET(mklrtls "gomp" "iomp5")
|
||||
ENDIF()
|
||||
SET(mklifaces "intel" "gf")
|
||||
SET(mklrtls "gomp" "iomp5")
|
||||
ELSE(CMAKE_COMPILER_IS_GNUCC)
|
||||
SET(mklthreads "mkl_intel_thread")
|
||||
IF (INTEL_MKL_TBB)
|
||||
SET(mklthreads "mkl_tbb_thread")
|
||||
SET(mklrtls "tbb")
|
||||
ELSE()
|
||||
SET(mklthreads "mkl_intel_thread")
|
||||
SET(mklrtls "iomp5" "guide")
|
||||
IF (MSVC)
|
||||
SET(mklrtls "libiomp5md")
|
||||
ENDIF (MSVC)
|
||||
ENDIF()
|
||||
SET(mklifaces "intel")
|
||||
SET(mklrtls "iomp5" "guide")
|
||||
IF (MSVC)
|
||||
SET(mklrtls "libiomp5md")
|
||||
ENDIF (MSVC)
|
||||
ENDIF (CMAKE_COMPILER_IS_GNUCC)
|
||||
|
||||
# Kernel libraries dynamically loaded
|
||||
|
|
@ -137,6 +157,7 @@ MACRO(CHECK_ALL_LIBRARIES LIBRARIES OPENMP_TYPE OPENMP_LIBRARY _name _list _flag
|
|||
endforeach(_elem)
|
||||
message(STATUS "Checking for [${_str_list}]")
|
||||
ENDIF ()
|
||||
SET(_found_tbb FALSE)
|
||||
FOREACH(_library ${_list})
|
||||
SET(_combined_name ${_combined_name}_${_library})
|
||||
UNSET(${_prefix}_${_library}_LIBRARY)
|
||||
|
|
@ -171,29 +192,36 @@ MACRO(CHECK_ALL_LIBRARIES LIBRARIES OPENMP_TYPE OPENMP_LIBRARY _name _list _flag
|
|||
ELSE()
|
||||
MESSAGE(FATAL_ERROR "Unknown OpenMP flavor: ${_library}")
|
||||
ENDIF()
|
||||
ELSE(${_library} MATCHES "omp")
|
||||
ELSEIF(${_library} STREQUAL "tbb")
|
||||
# Separately handling compiled TBB
|
||||
SET(_found_tbb TRUE)
|
||||
ELSE()
|
||||
FIND_LIBRARY(${_prefix}_${_library}_LIBRARY NAMES ${_library})
|
||||
ENDIF(${_library} MATCHES "omp")
|
||||
ENDIF()
|
||||
MARK_AS_ADVANCED(${_prefix}_${_library}_LIBRARY)
|
||||
SET(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY})
|
||||
SET(_libraries_work ${${_prefix}_${_library}_LIBRARY})
|
||||
IF (NOT MKL_FIND_QUIETLY)
|
||||
IF(${_prefix}_${_library}_LIBRARY)
|
||||
MESSAGE(STATUS " Library ${_library}: ${${_prefix}_${_library}_LIBRARY}")
|
||||
ELSE(${_prefix}_${_library}_LIBRARY)
|
||||
MESSAGE(STATUS " Library ${_library}: not found")
|
||||
ENDIF(${_prefix}_${_library}_LIBRARY)
|
||||
ENDIF ()
|
||||
IF(NOT (${_library} STREQUAL "tbb"))
|
||||
SET(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY})
|
||||
SET(_libraries_work ${${_prefix}_${_library}_LIBRARY})
|
||||
IF (NOT MKL_FIND_QUIETLY)
|
||||
IF(${_prefix}_${_library}_LIBRARY)
|
||||
MESSAGE(STATUS " Library ${_library}: ${${_prefix}_${_library}_LIBRARY}")
|
||||
ELSE(${_prefix}_${_library}_LIBRARY)
|
||||
MESSAGE(STATUS " Library ${_library}: not found")
|
||||
ENDIF(${_prefix}_${_library}_LIBRARY)
|
||||
ENDIF ()
|
||||
ENDIF()
|
||||
ENDIF(_libraries_work)
|
||||
ENDFOREACH(_library ${_list})
|
||||
# Test this combination of libraries.
|
||||
IF(_libraries_work)
|
||||
SET(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}})
|
||||
SET(CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES};${CMAKE_REQUIRED_LIBRARIES}")
|
||||
CHECK_FUNCTION_EXISTS(${_name} ${_prefix}${_combined_name}_WORKS)
|
||||
SET(CMAKE_REQUIRED_LIBRARIES)
|
||||
MARK_AS_ADVANCED(${_prefix}${_combined_name}_WORKS)
|
||||
SET(_libraries_work ${${_prefix}${_combined_name}_WORKS})
|
||||
IF (NOT _found_tbb)
|
||||
SET(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}})
|
||||
SET(CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES};${CMAKE_REQUIRED_LIBRARIES}")
|
||||
CHECK_FUNCTION_EXISTS(${_name} ${_prefix}${_combined_name}_WORKS)
|
||||
SET(CMAKE_REQUIRED_LIBRARIES)
|
||||
MARK_AS_ADVANCED(${_prefix}${_combined_name}_WORKS)
|
||||
SET(_libraries_work ${${_prefix}${_combined_name}_WORKS})
|
||||
ENDIF()
|
||||
ENDIF(_libraries_work)
|
||||
# Fin
|
||||
IF(_libraries_work)
|
||||
|
|
|
|||
|
|
@ -40,6 +40,9 @@ IF(MKL_FOUND)
|
|||
LIST(APPEND MKLDNN_LIBRARIES ${MKL_LIBRARIES})
|
||||
LIST(APPEND MKLDNN_INCLUDE_DIR ${MKL_INCLUDE_DIR})
|
||||
ELSE(MKL_FOUND)
|
||||
IF (MKLDNN_THREADING STREQUAL "TBB")
|
||||
message(FATAL_ERROR "Cannot use MKL small library when MKL-DNN is using TBB")
|
||||
ENDIF()
|
||||
# If we cannot find MKL, we will use the Intel MKL Small library
|
||||
# comes with ${MKLDNN_ROOT}/external
|
||||
IF(NOT IS_DIRECTORY ${MKLDNN_ROOT}/external)
|
||||
|
|
@ -89,8 +92,28 @@ ENDIF(MKL_FOUND)
|
|||
|
||||
IF(MKL_FOUND)
|
||||
SET(MKL_cmake_included TRUE)
|
||||
# Does not override if there's already value set, e.g. TBB
|
||||
SET(MKLDNN_THREADING "OMP:COMP" CACHE STRING "")
|
||||
ENDIF(MKL_FOUND)
|
||||
|
||||
IF (MKLDNN_THREADING STREQUAL "TBB")
|
||||
IF (USE_TBB)
|
||||
message(STATUS "MKL-DNN is using TBB")
|
||||
|
||||
set(TBB_cmake_included TRUE)
|
||||
set(Threading_cmake_included TRUE)
|
||||
|
||||
remove_definitions(-DMKLDNN_THR)
|
||||
add_definitions(-DMKLDNN_THR=MKLDNN_THR_TBB)
|
||||
|
||||
set(TBB_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/third_party/tbb/include")
|
||||
include_directories(${TBB_INCLUDE_DIRS})
|
||||
list(APPEND EXTRA_SHARED_LIBS tbb)
|
||||
ELSE()
|
||||
message(FATAL_ERROR "MKLDNN_THREADING is set to TBB but TBB is not used")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
SET(WITH_TEST FALSE CACHE BOOL "" FORCE)
|
||||
SET(WITH_EXAMPLE FALSE CACHE BOOL "" FORCE)
|
||||
SET(MKLDNN_LIBRARY_TYPE STATIC CACHE STRING "" FORCE)
|
||||
|
|
|
|||
|
|
@ -114,6 +114,7 @@ function (caffe2_print_configuration_summary)
|
|||
message(STATUS " OpenCV version : ${OpenCV_VERSION}")
|
||||
endif()
|
||||
message(STATUS " USE_OPENMP : ${USE_OPENMP}")
|
||||
message(STATUS " USE_TBB : ${USE_TBB}")
|
||||
message(STATUS " USE_PROF : ${USE_PROF}")
|
||||
message(STATUS " USE_QNNPACK : ${USE_QNNPACK}")
|
||||
message(STATUS " USE_REDIS : ${USE_REDIS}")
|
||||
|
|
|
|||
|
|
@ -109,6 +109,9 @@ function(caffe2_binary_target target_name_or_src)
|
|||
if (DEFINED Caffe2_MODULES)
|
||||
target_link_libraries(${__target} ${Caffe2_MODULES})
|
||||
endif()
|
||||
if (USE_TBB)
|
||||
target_include_directories(${__target} PUBLIC ${TBB_ROOT_DIR}/include)
|
||||
endif()
|
||||
install(TARGETS ${__target} DESTINATION bin)
|
||||
endfunction()
|
||||
|
||||
|
|
|
|||
5
setup.py
5
setup.py
|
|
@ -155,6 +155,10 @@
|
|||
# possible values:
|
||||
# OPENMP - use OpenMP for intra-op and native backend for inter-op tasks
|
||||
# NATIVE - use native thread pool for both intra- and inter-op tasks
|
||||
#
|
||||
# USE_TBB
|
||||
# use TBB for parallelization
|
||||
#
|
||||
|
||||
from __future__ import print_function
|
||||
from setuptools import setup, Extension, distutils, find_packages
|
||||
|
|
@ -285,6 +289,7 @@ def build_deps():
|
|||
check_file(os.path.join(third_party_path, "gloo", "CMakeLists.txt"))
|
||||
check_file(os.path.join(third_party_path, "pybind11", "CMakeLists.txt"))
|
||||
check_file(os.path.join(third_party_path, 'cpuinfo', 'CMakeLists.txt'))
|
||||
check_file(os.path.join(third_party_path, 'tbb', 'Makefile'))
|
||||
check_file(os.path.join(third_party_path, 'onnx', 'CMakeLists.txt'))
|
||||
check_file(os.path.join(third_party_path, 'foxi', 'CMakeLists.txt'))
|
||||
check_file(os.path.join(third_party_path, 'QNNPACK', 'CMakeLists.txt'))
|
||||
|
|
|
|||
1
third_party/tbb
vendored
Submodule
1
third_party/tbb
vendored
Submodule
|
|
@ -0,0 +1 @@
|
|||
Subproject commit a51a90bc609bb73db8ea13841b5cf7aa4344d4a9
|
||||
|
|
@ -27,7 +27,7 @@ git fetch fullrepo
|
|||
git checkout -b temporary-split-branch fullrepo/master
|
||||
# Cribbed from https://stackoverflow.com/questions/2982055/detach-many-subdirectories-into-a-new-separate-git-repository
|
||||
# and https://stackoverflow.com/questions/42355621/git-filter-branch-moving-a-folder-with-index-filter-does-not-work
|
||||
git filter-branch -f --index-filter 'git rm --cached -qr --ignore-unmatch -- . && git reset -q $GIT_COMMIT -- aten cmake third_party/catch third_party/cpuinfo && (git ls-files -s | sed "s-.travis.aten.yml-.travis.yml-" | sed "s-.gitmodules.aten-.gitmodules-" | git update-index --index-info)'
|
||||
git filter-branch -f --index-filter 'git rm --cached -qr --ignore-unmatch -- . && git reset -q $GIT_COMMIT -- aten cmake third_party/tbb third_party/catch third_party/cpuinfo && (git ls-files -s | sed "s-.travis.aten.yml-.travis.yml-" | sed "s-.gitmodules.aten-.gitmodules-" | git update-index --index-info)'
|
||||
git checkout master
|
||||
git merge temporary-split-branch
|
||||
git push
|
||||
|
|
|
|||
|
|
@ -219,9 +219,15 @@ def run_cmake(version,
|
|||
if os.getenv('USE_OPENMP'):
|
||||
cmake_defines(cmake_args, USE_OPENMP=check_env_flag('USE_OPENMP'))
|
||||
|
||||
if os.getenv('USE_TBB'):
|
||||
cmake_defines(cmake_args, USE_TBB=check_env_flag('USE_TBB'))
|
||||
|
||||
if os.getenv('MKL_SEQ'):
|
||||
cmake_defines(cmake_args, INTEL_MKL_SEQUENTIAL=check_env_flag('MKL_SEQ'))
|
||||
|
||||
if os.getenv('MKL_TBB'):
|
||||
cmake_defines(cmake_args, INTEL_MKL_TBB=check_env_flag('MKL_TBB'))
|
||||
|
||||
mkldnn_threading = os.getenv('MKLDNN_THREADING')
|
||||
if mkldnn_threading:
|
||||
cmake_defines(cmake_args, MKLDNN_THREADING=mkldnn_threading)
|
||||
|
|
|
|||
|
|
@ -13,6 +13,10 @@ if (NOT BUILD_PYTHON)
|
|||
return()
|
||||
endif()
|
||||
|
||||
if (USE_TBB)
|
||||
include_directories(${TBB_ROOT_DIR}/include)
|
||||
endif()
|
||||
|
||||
set(TORCH_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
set(TORCH_ROOT "${TORCH_SRC_DIR}/..")
|
||||
|
||||
|
|
@ -243,10 +247,6 @@ if (USE_NCCL)
|
|||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
add_custom_target(torch_python_stubs DEPENDS "${TORCH_SRC_DIR}/__init__.pyi")
|
||||
# For Declarations.yaml dependency
|
||||
add_dependencies(torch_python_stubs ATEN_CPU_FILES_GEN_TARGET)
|
||||
|
|
@ -263,8 +263,6 @@ add_custom_command(
|
|||
"${TORCH_ROOT}"
|
||||
)
|
||||
|
||||
|
||||
|
||||
add_library(torch_python SHARED ${TORCH_PYTHON_SRCS})
|
||||
|
||||
# Required workaround for generated sources
|
||||
|
|
|
|||
|
|
@ -44,6 +44,10 @@ FIND_PACKAGE(MPI)
|
|||
|
||||
INCLUDE_DIRECTORIES(${CAFFE2_INCLUDE_DIR})
|
||||
|
||||
if (USE_TBB)
|
||||
include_directories(${TBB_ROOT_DIR}/include)
|
||||
endif()
|
||||
|
||||
IF(USE_CUDA)
|
||||
FIND_PACKAGE(CUDA 7.5)
|
||||
IF(CUDA_FOUND)
|
||||
|
|
|
|||
Loading…
Reference in a new issue