Skip to content

Commit 1807034

Browse files
committed
Committing TBB 2020 source code
1 parent a803f27 commit 1807034

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1474
-109
lines changed

CHANGES

+19-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@
22
The list of most significant changes made over time in
33
Intel(R) Threading Building Blocks (Intel(R) TBB).
44

5+
Intel TBB 2020
6+
TBB_INTERFACE_VERSION == 11100
7+
8+
Changes (w.r.t. Intel TBB 2019 Update 9):
9+
10+
- Extended task_arena interface to simplify development of NUMA-aware
11+
applications.
12+
- Added warning notifications when the deprecated functionality is used.
13+
14+
Open-source contributions integrated:
15+
16+
- Fixed various build warnings
17+
(https://github.com/intel/tbb/pull/179) by Raf Schietekat.
18+
19+
------------------------------------------------------------------------
520
Intel TBB 2019 Update 9
621
TBB_INTERFACE_VERSION == 11009
722

@@ -13,7 +28,7 @@ Changes (w.r.t. Intel TBB 2019 Update 8):
1328

1429
Preview Features:
1530

16-
- Added isolated_task_group class that allows multiple threads to add
31+
- Added isolated_task_group class that allows multiple threads to add
1732
and execute tasks sharing the same isolation.
1833
- Extended the flow graph API to simplify connecting nodes.
1934
- Added erase() by heterogeneous keys for concurrent ordered containers.
@@ -27,6 +42,9 @@ Bugs fixed:
2742
- Fixed a bug in the merge() method of concurrent unordered
2843
containers.
2944
- Fixed behavior of a continue_node that follows buffering nodes.
45+
- Fixed compilation error caused by missed stdlib.h when CMake
46+
integration is used (https://github.com/intel/tbb/issues/195).
47+
Inspired by Andrew Penkrat.
3048

3149
Open-source contributions integrated:
3250

Makefile

+5-11
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# limitations under the License.
1414

1515
tbb_root?=.
16+
cfg?=release
1617
include $(tbb_root)/build/common.inc
1718
.PHONY: default all tbb tbbmalloc tbbproxy test examples
1819

@@ -25,25 +26,22 @@ default: tbb tbbmalloc $(if $(use_proxy),tbbproxy)
2526
all: tbb tbbmalloc tbbproxy test examples
2627

2728
tbb: mkdir
28-
$(MAKE) -C "$(work_dir)_debug" -r -f $(tbb_root)/build/Makefile.tbb cfg=debug
2929
$(MAKE) -C "$(work_dir)_release" -r -f $(tbb_root)/build/Makefile.tbb cfg=release
3030

3131
tbbmalloc: mkdir
32-
$(MAKE) -C "$(work_dir)_debug" -r -f $(tbb_root)/build/Makefile.tbbmalloc cfg=debug malloc
3332
$(MAKE) -C "$(work_dir)_release" -r -f $(tbb_root)/build/Makefile.tbbmalloc cfg=release malloc
3433

3534
tbbproxy: mkdir
36-
$(MAKE) -C "$(work_dir)_debug" -r -f $(tbb_root)/build/Makefile.tbbproxy cfg=debug tbbproxy
3735
$(MAKE) -C "$(work_dir)_release" -r -f $(tbb_root)/build/Makefile.tbbproxy cfg=release tbbproxy
3836

37+
tbbbind: mkdir
38+
$(MAKE) -C "$(work_dir)_release" -r -f $(tbb_root)/build/Makefile.tbbbind cfg=release tbbbind
39+
3940
test: tbb tbbmalloc $(if $(use_proxy),tbbproxy)
40-
-$(MAKE) -C "$(work_dir)_debug" -r -f $(tbb_root)/build/Makefile.tbbmalloc cfg=debug malloc_test
41-
-$(MAKE) -C "$(work_dir)_debug" -r -f $(tbb_root)/build/Makefile.test cfg=debug
4241
-$(MAKE) -C "$(work_dir)_release" -r -f $(tbb_root)/build/Makefile.tbbmalloc cfg=release malloc_test
4342
-$(MAKE) -C "$(work_dir)_release" -r -f $(tbb_root)/build/Makefile.test cfg=release
4443

4544
rml: mkdir
46-
$(MAKE) -C "$(work_dir)_debug" -r -f $(tbb_root)/build/Makefile.rml cfg=debug
4745
$(MAKE) -C "$(work_dir)_release" -r -f $(tbb_root)/build/Makefile.rml cfg=release
4846

4947
examples: tbb tbbmalloc
@@ -60,22 +58,18 @@ doxygen:
6058
clean: clean_examples
6159
$(shell $(RM) $(work_dir)_release$(SLASH)*.* >$(NUL) 2>$(NUL))
6260
$(shell $(RD) $(work_dir)_release >$(NUL) 2>$(NUL))
63-
$(shell $(RM) $(work_dir)_debug$(SLASH)*.* >$(NUL) 2>$(NUL))
64-
$(shell $(RD) $(work_dir)_debug >$(NUL) 2>$(NUL))
6561
@echo clean done
6662

6763
clean_examples:
6864
$(shell $(MAKE) -s -i -r -C examples -f Makefile tbb_root=.. clean >$(NUL) 2>$(NUL))
6965

7066
mkdir:
7167
$(shell $(MD) "$(work_dir)_release" >$(NUL) 2>$(NUL))
72-
$(shell $(MD) "$(work_dir)_debug" >$(NUL) 2>$(NUL))
73-
@echo Created $(work_dir)_release and ..._debug directories
68+
@echo Created the $(work_dir)_release directory
7469

7570
info:
7671
@echo OS: $(tbb_os)
7772
@echo arch=$(arch)
7873
@echo compiler=$(compiler)
7974
@echo runtime=$(runtime)
8075
@echo tbb_build_prefix=$(tbb_build_prefix)
81-

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Threading Building Blocks 2019 Update 9
2-
[![Stable release](https://img.shields.io/badge/version-2019_U9-green.svg)](https://github.com/intel/tbb/releases/tag/2019_U9)
1+
# Threading Building Blocks 2020
2+
[![Stable release](https://img.shields.io/badge/version-2020-green.svg)](https://github.com/intel/tbb/releases/tag/2020)
33
[![Apache License Version 2.0](https://img.shields.io/badge/license-Apache_2.0-green.svg)](LICENSE)
44

55
Threading Building Blocks (TBB) lets you easily write parallel C++ programs that take

build/Makefile.tbbbind

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Copyright (c) 2005-2019 Intel Corporation
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
#------------------------------------------------------------------------------
16+
# Define rules for making the tbbbind shared library.
17+
#------------------------------------------------------------------------------
18+
19+
tbb_root ?= "$(TBBROOT)"
20+
BUILDING_PHASE=1
21+
include $(tbb_root)/build/common.inc
22+
CPLUS_FLAGS += $(SDL_FLAGS)
23+
DEBUG_SUFFIX=$(findstring _debug,_$(cfg))
24+
25+
#------------------------------------------------------------
26+
# Define static pattern rules dealing with .cpp source files
27+
#------------------------------------------------------------
28+
$(warning CONFIG: cfg=$(cfg) arch=$(arch) compiler=$(compiler) target=$(target) runtime=$(runtime))
29+
30+
.PHONY: tbbbind
31+
.PRECIOUS: %.$(OBJ)
32+
33+
VPATH = $(tbb_root)/src/tbb/$(ASSEMBLY_SOURCE) $(tbb_root)/src/tbb $(tbb_root)/src/old $(tbb_root)/src/rml/client
34+
35+
CPLUS_FLAGS += $(PIC_KEY) $(DSE_KEY)
36+
37+
# Suppress superfluous warnings for tbbbind compilation
38+
WARNING_KEY += $(WARNING_SUPPRESS)
39+
40+
include $(tbb_root)/build/common_rules.inc
41+
42+
TBBBIND.OBJ = tbbbind.$(OBJ)
43+
44+
ifneq (,$(TBBBIND.DEF))
45+
tbbbind.def: $(TBBBIND.DEF)
46+
$(CPLUS) $(PREPROC_ONLY) $< $(CPLUS_FLAGS) $(INCLUDES) > $@
47+
48+
LIB_LINK_FLAGS += $(EXPORT_KEY)tbbbind.def
49+
$(TBBBIND.DLL): tbbbind.def
50+
endif
51+
52+
ifneq (,$(TBBBIND.DLL))
53+
$(TBBBIND.DLL): BUILDING_LIBRARY = $(TBBBIND.DLL)
54+
$(TBBBIND.DLL): $(TBBBIND.OBJ) $(TBBBIND_NO_VERSION.DLL)
55+
$(LIB_LINK_CMD) $(LIB_OUTPUT_KEY)$(TBBBIND.DLL) $(TBBBIND.OBJ) $(HWLOC.LIB) $(LINK_TBB.LIB) $(LIB_LINK_FLAGS)
56+
endif
57+
58+
ifneq (,$(TBBBIND_NO_VERSION.DLL))
59+
$(TBBBIND_NO_VERSION.DLL):
60+
echo "INPUT ($(TBBBIND.DLL))" > $(TBBBIND_NO_VERSION.DLL)
61+
endif
62+
63+
tbbbind: $(TBB.DLL) $(TBBBIND.DLL)
64+
65+
#clean:
66+
# $(RM) *.$(OBJ) *.$(DLL) *.res *.map *.ilk *.pdb *.exp *.manifest *.tmp *.d core core.*[0-9][0-9] *.ver
67+
68+
# Include automatically generated dependencies
69+
-include *.d

build/Makefile.test

+2
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,8 @@ endif
252252

253253
test_opencl_node.$(TEST_EXT): LIBS += $(OPENCL.LIB)
254254

255+
test_arena_constraints_hwloc.$(TEST_EXT): LIBS += $(HWLOC.LIB)
256+
255257
$(TEST_TBB_PLAIN.EXE) $(TEST_TBB_SPECIAL.EXE): WARNING_KEY += $(TEST_WARNING_KEY)
256258

257259
# Run tests that are in SCHEDULER_DIRECTLY_INCLUDED and TEST_TBB_PLAIN.EXE but not in skip_tests (which is specified by user)

build/index.html

+8-3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ <H2>Files</H2>
1818
<DT><A HREF="Makefile.tbbmalloc">Makefile.tbbmalloc</A>
1919
<DD>Main Makefile to build the Intel TBB scalable memory allocator library as well as its tests.
2020
Invoked via 'make tbbmalloc' from <A HREF="../Makefile">top-level Makefile</A>.
21+
<DT><A HREF="Makefile.tbbbind">Makefile.tbbbind</A>
22+
<DD>Main Makefile to build the tbbbind library.
23+
Invoked via 'make tbbbind' from <A HREF="../Makefile">top-level Makefile</A>
2124
<DT><A HREF="Makefile.test">Makefile.test</A>
2225
<DD>Main Makefile to build and run the tests for the Intel TBB library.
2326
Invoked via 'make test' from <A HREF="../Makefile">top-level Makefile</A>.
@@ -73,7 +76,7 @@ <H3>Software prerequisites:</H3>
7376
<LI>Explicitly specify the architecture when invoking GNU make, e.g. <TT>make arch=ia32</TT>.
7477
</OL>
7578

76-
<P>The default make target will build the release and debug versions of the Intel TBB library.</P>
79+
<P>The default make target will build the release version of the Intel TBB library.</P>
7780
<P>Other targets are available in the top-level Makefile. You might find the following targets useful:
7881
<UL>
7982
<LI><TT>make test</TT> will build and run Intel TBB <A HREF="../src/test">unit-tests</A>;
@@ -111,13 +114,15 @@ <H3>Software prerequisites:</H3>
111114
<DT><TT>cd src;make debug</TT>
112115
<DD>Build and test debug libraries only.
113116
<DT><TT>make tbb</TT>
114-
<DD>Make Intel TBB release and debug libraries.
117+
<DD>Make Intel TBB release libraries.
115118
<DT><TT>make tbbmalloc</TT>
116119
<DD>Make Intel TBB scalable memory allocator libraries.
120+
<DT><TT>make tbbbind</TT>
121+
<DD>Make the tbbbind library.
117122
<DT><TT>make test</TT>
118123
<DD>Compile and run unit-tests
119124
<DT><TT>make examples</TT>
120-
<DD>Build libraries and run all examples, like doing <TT>make debug clean release</TT> from <A HREF="../examples/Makefile">the general example Makefile</A>.
125+
<DD>Build libraries and run all examples, like doing <TT>make clean release</TT> from <A HREF="../examples/Makefile">the general example Makefile</A>.
121126
Available in the open-source version only.
122127
<DT><TT>make python</TT>
123128
<DD>Build, install, and test Python* API for Intel TBB. See <A HREF="../python/index.html">details here</A>.

build/linux.inc

+7
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,13 @@ TBB.LIB = $(TBB.DLL)
116116
TBB_NO_VERSION.DLL=libtbb$(CPF_SUFFIX)$(DEBUG_SUFFIX).$(DLL)
117117
LINK_TBB.LIB = $(TBB_NO_VERSION.DLL)
118118

119+
TBBBIND_NO_VERSION.DLL = libtbbbind$(DEBUG_SUFFIX).$(DLL)
120+
TBBBIND.DEF = $(tbb_root)/src/tbb/$(def_prefix)-tbbbind-export.def
121+
TBBBIND.DLL = $(TBBBIND_NO_VERSION.DLL).$(SONAME_SUFFIX)
122+
TBBBIND.LIB = $(TBBBIND_NO_VERSION.DLL)
123+
LINK_TBBBIND.LIB = $(TBBBIND.LIB)
124+
HWLOC.LIB = -lhwloc
125+
119126
MALLOC_NO_VERSION.DLL = libtbbmalloc$(DEBUG_SUFFIX).$(MALLOC_DLL)
120127
MALLOC.DEF = $(MALLOC_ROOT)/$(def_prefix)-tbbmalloc-export.def
121128
MALLOC.DLL = $(MALLOC_NO_VERSION.DLL).$(SONAME_SUFFIX)

build/windows.inc

+7
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,13 @@ ifneq ($(filter vc8 vc9,$(runtime)),)
7979
TBB.MANIFEST = tbbmanifest.exe.manifest
8080
endif
8181

82+
TBBBIND.DEF = $(tbb_root)/src/tbb/$(def_prefix)-tbbbind-export.def
83+
TBBBIND.DLL = tbbbind$(DEBUG_SUFFIX).$(DLL)
84+
TBBBIND.LIB = tbbbind$(DEBUG_SUFFIX).$(LIBEXT)
85+
TBBBIND.RES = tbbbind.res
86+
LINK_TBBBIND.LIB = $(TBBBIND.LIB)
87+
HWLOC.LIB = libhwloc.$(LIBEXT)
88+
8289
MALLOC.DEF = $(MALLOC_ROOT)/$(def_prefix)-tbbmalloc-export.def
8390
MALLOC.DLL = tbbmalloc$(DEBUG_SUFFIX).$(DLL)
8491
MALLOC.LIB = tbbmalloc$(DEBUG_SUFFIX).$(LIBEXT)

cmake/README.rst

+1
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ If ``tbbmalloc_proxy`` is requested, ``tbbmalloc`` component will also be added
197197
TBBConfig creates `imported targets <https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#imported-targets>`_ as
198198
shared libraries using the following format: ``TBB::<component>`` (for example, ``TBB::tbb``, ``TBB::tbbmalloc``).
199199

200+
Set ``TBB_FIND_RELEASE_ONLY`` to ``TRUE`` before ``find_package`` call in order to search only for release TBB version. This variable helps to avoid simultaneous linkage of release and debug TBB versions when CMake configuration is `Debug` but a third-party component depends on release TBB version.
200201
Variables set during TBB configuration:
201202

202203
========================= ================================================

cmake/templates/TBBConfig.cmake.in

+14-6
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,20 @@ unset(_tbbmalloc_proxy_ix)
4747
foreach (_tbb_component ${TBB_FIND_COMPONENTS})
4848
set(TBB_${_tbb_component}_FOUND 0)
4949

50-
set(_tbb_release_lib "${CMAKE_CURRENT_LIST_DIR}/@TBB_LIB_REL_PATH@/@TBB_LIB_PREFIX@${_tbb_component}.@TBB_LIB_EXT@")
51-
set(_tbb_debug_lib "${CMAKE_CURRENT_LIST_DIR}/@TBB_LIB_REL_PATH@/@TBB_LIB_PREFIX@${_tbb_component}_debug.@TBB_LIB_EXT@")
50+
get_filename_component(_tbb_release_lib "${CMAKE_CURRENT_LIST_DIR}/@TBB_LIB_REL_PATH@/@TBB_LIB_PREFIX@${_tbb_component}.@TBB_LIB_EXT@" ABSOLUTE)
51+
52+
if (NOT TBB_FIND_RELEASE_ONLY)
53+
get_filename_component(_tbb_debug_lib "${CMAKE_CURRENT_LIST_DIR}/@TBB_LIB_REL_PATH@/@TBB_LIB_PREFIX@${_tbb_component}_debug.@TBB_LIB_EXT@" ABSOLUTE)
54+
endif()
5255

5356
if (EXISTS "${_tbb_release_lib}" OR EXISTS "${_tbb_debug_lib}")
5457
if (NOT TARGET TBB::${_tbb_component})
5558
add_library(TBB::${_tbb_component} SHARED IMPORTED)
59+
60+
get_filename_component(_tbb_include_dir "${CMAKE_CURRENT_LIST_DIR}/@TBB_INC_REL_PATH@" ABSOLUTE)
5661
set_target_properties(TBB::${_tbb_component} PROPERTIES
57-
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_LIST_DIR}/@TBB_INC_REL_PATH@")
62+
INTERFACE_INCLUDE_DIRECTORIES "${_tbb_include_dir}")
63+
unset(_tbb_include_dir)
5864

5965
if (EXISTS "${_tbb_release_lib}")
6066
set_target_properties(TBB::${_tbb_component} PROPERTIES
@@ -72,14 +78,16 @@ foreach (_tbb_component ${TBB_FIND_COMPONENTS})
7278
if (_tbb_component STREQUAL tbbmalloc_proxy)
7379
set_target_properties(TBB::tbbmalloc_proxy PROPERTIES INTERFACE_LINK_LIBRARIES TBB::tbbmalloc)
7480
endif()
75-
else()
76-
message(STATUS "Using previously found TBB::${_tbb_component}")
7781
endif()
7882
list(APPEND TBB_IMPORTED_TARGETS TBB::${_tbb_component})
7983
set(TBB_${_tbb_component}_FOUND 1)
8084
elseif (TBB_FIND_REQUIRED AND TBB_FIND_REQUIRED_${_tbb_component})
8185
message(STATUS "Missed required Intel TBB component: ${_tbb_component}")
82-
message(STATUS " one or both of:\n ${_tbb_release_lib}\n ${_tbb_debug_lib}\n files must exist.")
86+
if (TBB_FIND_RELEASE_ONLY)
87+
message(STATUS " ${_tbb_release_lib} must exist.")
88+
else()
89+
message(STATUS " one or both of:\n ${_tbb_release_lib}\n ${_tbb_debug_lib}\n files must exist.")
90+
endif()
8391
set(TBB_FOUND FALSE)
8492
endif()
8593
endforeach()

cmake/templates/TBBConfigInternal.cmake.in

+9-4
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@ foreach (_tbb_component ${TBB_FIND_COMPONENTS})
4949
set(TBB_${_tbb_component}_FOUND 0)
5050

5151
set(_tbb_release_lib "@TBB_RELEASE_LIB_PATH@/@TBB_LIB_PREFIX@${_tbb_component}.@TBB_LIB_EXT@")
52-
set(_tbb_debug_lib "@TBB_DEBUG_LIB_PATH@/@TBB_LIB_PREFIX@${_tbb_component}_debug.@TBB_LIB_EXT@")
52+
53+
if (NOT TBB_FIND_RELEASE_ONLY)
54+
set(_tbb_debug_lib "@TBB_DEBUG_LIB_PATH@/@TBB_LIB_PREFIX@${_tbb_component}_debug.@TBB_LIB_EXT@")
55+
endif()
5356

5457
if (EXISTS "${_tbb_release_lib}" OR EXISTS "${_tbb_debug_lib}")
5558
if (NOT TARGET TBB::${_tbb_component})
@@ -73,14 +76,16 @@ foreach (_tbb_component ${TBB_FIND_COMPONENTS})
7376
if (_tbb_component STREQUAL tbbmalloc_proxy)
7477
set_target_properties(TBB::tbbmalloc_proxy PROPERTIES INTERFACE_LINK_LIBRARIES TBB::tbbmalloc)
7578
endif()
76-
else()
77-
message(STATUS "Using previously found TBB::${_tbb_component}")
7879
endif()
7980
list(APPEND TBB_IMPORTED_TARGETS TBB::${_tbb_component})
8081
set(TBB_${_tbb_component}_FOUND 1)
8182
elseif (TBB_FIND_REQUIRED AND TBB_FIND_REQUIRED_${_tbb_component})
8283
message(STATUS "Missed required Intel TBB component: ${_tbb_component}")
83-
message(STATUS " one or both of:\n ${_tbb_release_lib}\n ${_tbb_debug_lib}\n files must exist.")
84+
if (TBB_FIND_RELEASE_ONLY)
85+
message(STATUS " ${_tbb_release_lib} must exist.")
86+
else()
87+
message(STATUS " one or both of:\n ${_tbb_release_lib}\n ${_tbb_debug_lib}\n files must exist.")
88+
endif()
8489
set(TBB_FOUND FALSE)
8590
endif()
8691
endforeach()

0 commit comments

Comments
 (0)