Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
ngraph
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ngraph
Commits
c7e47d1f
Unverified
Commit
c7e47d1f
authored
Feb 15, 2019
by
Sang Ik Lee
Committed by
GitHub
Feb 15, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move TBB out of CPU backend. (#2458)
parent
99245594
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
32 deletions
+34
-32
external_tbb.cmake
cmake/external_tbb.cmake
+30
-0
CMakeLists.txt
src/ngraph/runtime/cpu/CMakeLists.txt
+4
-32
No files found.
cmake/external_tbb.cmake
View file @
c7e47d1f
...
...
@@ -29,4 +29,34 @@ if(NGRAPH_TBB_ENABLE)
WORKING_DIRECTORY
"
${
CMAKE_CURRENT_BINARY_DIR
}
/tbb"
)
execute_process
(
COMMAND
"
${
CMAKE_COMMAND
}
"
--build .
WORKING_DIRECTORY
"
${
CMAKE_CURRENT_BINARY_DIR
}
/tbb"
)
include
(
${
TBB_ROOT
}
/cmake/TBBBuild.cmake
)
tbb_build
(
TBB_ROOT
${
TBB_ROOT
}
MAKE_ARGS tbb_build_dir=
${
CMAKE_CURRENT_BINARY_DIR
}
/tbb_build
tbb_build_prefix=tbb CONFIG_DIR TBB_DIR
)
find_package
(
TBB REQUIRED tbb
)
if
(
NOT TBB_FOUND
)
message
(
FATAL_ERROR
"TBB is needed by the CPU backend and was not found"
)
else
()
message
(
STATUS
"Found TBB and imported target
${
TBB_IMPORTED_TARGETS
}
"
)
endif
()
set_source_files_properties
(
cpu_external_function.cpp
PROPERTIES COMPILE_DEFINITIONS
"NGRAPH_TBB_ENABLE"
)
if
(
CMAKE_BUILD_TYPE STREQUAL
"Debug"
)
set
(
TBB_LIB_NAME tbb_debug
)
set
(
TBB_BUILDDIR_NAME tbb_debug
)
else
()
set
(
TBB_LIB_NAME tbb
)
set
(
TBB_BUILDDIR_NAME tbb_release
)
endif
()
install
(
DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
/tbb_build/
${
TBB_BUILDDIR_NAME
}
/
DESTINATION
${
NGRAPH_INSTALL_LIB
}
FILES_MATCHING REGEX
"/
${
CMAKE_SHARED_LIBRARY_PREFIX
}${
TBB_LIB_NAME
}${
CMAKE_SHARED_LIBRARY_SUFFIX
}
(
\\
.[0-9]+)*$"
)
add_library
(
libtbb INTERFACE
)
target_link_libraries
(
libtbb INTERFACE
${
CMAKE_CURRENT_BINARY_DIR
}
/tbb_build/
${
TBB_BUILDDIR_NAME
}
/
${
CMAKE_SHARED_LIBRARY_PREFIX
}${
TBB_LIB_NAME
}${
CMAKE_SHARED_LIBRARY_SUFFIX
}
)
target_include_directories
(
libtbb SYSTEM INTERFACE
${
TBB_ROOT
}
/include
)
endif
()
src/ngraph/runtime/cpu/CMakeLists.txt
View file @
c7e47d1f
...
...
@@ -133,38 +133,6 @@ if (NGRAPH_HALIDE)
)
endif
()
if
(
NGRAPH_TBB_ENABLE AND
NOT
(
WIN32 OR APPLE
))
include
(
${
TBB_ROOT
}
/cmake/TBBBuild.cmake
)
tbb_build
(
TBB_ROOT
${
TBB_ROOT
}
MAKE_ARGS tbb_build_dir=
${
CMAKE_CURRENT_BINARY_DIR
}
/tbb_build
tbb_build_prefix=tbb CONFIG_DIR TBB_DIR
)
find_package
(
TBB REQUIRED tbb
)
if
(
NOT TBB_FOUND
)
message
(
FATAL_ERROR
"TBB is needed by the CPU backend and was not found"
)
else
()
message
(
STATUS
"Found TBB and imported target
${
TBB_IMPORTED_TARGETS
}
"
)
endif
()
set_source_files_properties
(
cpu_external_function.cpp
PROPERTIES COMPILE_DEFINITIONS
"NGRAPH_TBB_ENABLE"
)
if
(
CMAKE_BUILD_TYPE STREQUAL
"Debug"
)
set
(
TBB_LIB_NAME tbb_debug
)
set
(
TBB_BUILDDIR_NAME tbb_debug
)
else
()
set
(
TBB_LIB_NAME tbb
)
set
(
TBB_BUILDDIR_NAME tbb_release
)
endif
()
install
(
DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
/tbb_build/
${
TBB_BUILDDIR_NAME
}
/
DESTINATION
${
NGRAPH_INSTALL_LIB
}
FILES_MATCHING REGEX
"/
${
CMAKE_SHARED_LIBRARY_PREFIX
}${
TBB_LIB_NAME
}${
CMAKE_SHARED_LIBRARY_SUFFIX
}
(
\\
.[0-9]+)*$"
)
add_library
(
libtbb INTERFACE
)
target_link_libraries
(
libtbb INTERFACE
${
CMAKE_CURRENT_BINARY_DIR
}
/tbb_build/
${
TBB_BUILDDIR_NAME
}
/
${
CMAKE_SHARED_LIBRARY_PREFIX
}${
TBB_LIB_NAME
}${
CMAKE_SHARED_LIBRARY_SUFFIX
}
)
target_include_directories
(
libtbb SYSTEM INTERFACE
${
TBB_ROOT
}
/include
)
endif
()
if
(
NGRAPH_CPU_ENABLE
)
set
(
NGRAPH_CPU_DEBUGINFO_ENABLE 0 CACHE STRING
"Enable debuginfo in the CPU backend"
)
...
...
@@ -177,6 +145,10 @@ if (NGRAPH_CPU_ENABLE)
if
(
NGRAPH_DEX_ONLY
)
target_compile_definitions
(
cpu_backend PRIVATE
"NGRAPH_DEX_ONLY"
)
endif
()
if
(
NGRAPH_TBB_ENABLE
)
set_source_files_properties
(
cpu_external_function.cpp
PROPERTIES COMPILE_DEFINITIONS
"NGRAPH_TBB_ENABLE"
)
endif
()
if
(
NGRAPH_HALIDE
)
target_compile_definitions
(
cpu_backend PRIVATE
"NGRAPH_HALIDE"
)
ExternalProject_Get_Property
(
ext_halide BINARY_DIR
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment