Skip to content
Permalink
Browse files

Committing TBB 2020 source code

  • Loading branch information
tbbdev committed Dec 18, 2019
1 parent a803f27 commit 18070344d755ece04d169e6cc40775cae9288cee
Showing with 1,474 additions and 109 deletions.
  1. +19 −1 CHANGES
  2. +5 −11 Makefile
  3. +2 −2 README.md
  4. +69 −0 build/Makefile.tbbbind
  5. +2 −0 build/Makefile.test
  6. +8 −3 build/index.html
  7. +7 −0 build/linux.inc
  8. +7 −0 build/windows.inc
  9. +1 −0 cmake/README.rst
  10. +14 −6 cmake/templates/TBBConfig.cmake.in
  11. +9 −4 cmake/templates/TBBConfigInternal.cmake.in
  12. +47 −43 doc/Release_Notes.txt
  13. +3 −1 include/tbb/concurrent_hash_map.h
  14. +2 −0 include/tbb/flow_graph.h
  15. +52 −0 include/tbb/info.h
  16. +1 −1 include/tbb/internal/_aggregator_impl.h
  17. +76 −4 include/tbb/task_arena.h
  18. +5 −7 include/tbb/tbb_config.h
  19. +1 −1 include/tbb/tbb_exception.h
  20. +3 −3 include/tbb/tbb_stddef.h
  21. +15 −4 src/Makefile
  22. +1 −1 src/perf/time_resumable_tasks.cpp
  23. +20 −1 src/tbb/arena.cpp
  24. +5 −0 src/tbb/arena.h
  25. +1 −1 src/tbb/co_context.h
  26. +148 −0 src/tbb/governor.cpp
  27. +5 −0 src/tbb/lin32-tbb-export.lst
  28. +22 −0 src/tbb/lin32-tbbbind-export.def
  29. +5 −0 src/tbb/lin64-tbb-export.lst
  30. +22 −0 src/tbb/lin64-tbbbind-export.def
  31. +5 −0 src/tbb/mac32-tbb-export.lst
  32. +5 −0 src/tbb/mac64-tbb-export.lst
  33. +2 −1 src/tbb/observer_proxy.cpp
  34. +6 −0 src/tbb/scheduler.h
  35. +2 −0 src/tbb/task_group_context.cpp
  36. +30 −0 src/tbb/tbb_misc.h
  37. +309 −0 src/tbb/tbbbind.cpp
  38. +5 −0 src/tbb/win32-tbb-export.lst
  39. +20 −0 src/tbb/win32-tbbbind-export.def
  40. +5 −0 src/tbb/win64-gcc-tbb-export.lst
  41. +5 −0 src/tbb/win64-tbb-export.lst
  42. +20 −0 src/tbb/win64-tbbbind-export.def
  43. +28 −0 src/test/harness.h
  44. +2 −3 src/test/test_aggregator.cpp
  45. +361 −0 src/test/test_arena_constraints_hwloc.cpp
  46. +41 −0 src/test/test_arena_constraints_stubs.cpp
  47. +3 −3 src/test/test_concurrent_associative_common.h
  48. +1 −0 src/test/test_join_node.cpp
  49. +39 −0 src/test/test_resumable_tasks.cpp
  50. +6 −6 src/test/test_source_node.cpp
  51. +2 −2 src/test/test_tbb_version.cpp
20 CHANGES
@@ -2,6 +2,21 @@
The list of most significant changes made over time in
Intel(R) Threading Building Blocks (Intel(R) TBB).

Intel TBB 2020
TBB_INTERFACE_VERSION == 11100

Changes (w.r.t. Intel TBB 2019 Update 9):

- Extended task_arena interface to simplify development of NUMA-aware
applications.
- Added warning notifications when the deprecated functionality is used.

Open-source contributions integrated:

- Fixed various build warnings
(https://github.com/intel/tbb/pull/179) by Raf Schietekat.

------------------------------------------------------------------------
Intel TBB 2019 Update 9
TBB_INTERFACE_VERSION == 11009

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

Preview Features:

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

Open-source contributions integrated:

@@ -13,6 +13,7 @@
# limitations under the License.

tbb_root?=.
cfg?=release
include $(tbb_root)/build/common.inc
.PHONY: default all tbb tbbmalloc tbbproxy test examples

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

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

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

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

tbbbind: mkdir
$(MAKE) -C "$(work_dir)_release" -r -f $(tbb_root)/build/Makefile.tbbbind cfg=release tbbbind

test: tbb tbbmalloc $(if $(use_proxy),tbbproxy)
-$(MAKE) -C "$(work_dir)_debug" -r -f $(tbb_root)/build/Makefile.tbbmalloc cfg=debug malloc_test
-$(MAKE) -C "$(work_dir)_debug" -r -f $(tbb_root)/build/Makefile.test cfg=debug
-$(MAKE) -C "$(work_dir)_release" -r -f $(tbb_root)/build/Makefile.tbbmalloc cfg=release malloc_test
-$(MAKE) -C "$(work_dir)_release" -r -f $(tbb_root)/build/Makefile.test cfg=release

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

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

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

mkdir:
$(shell $(MD) "$(work_dir)_release" >$(NUL) 2>$(NUL))
$(shell $(MD) "$(work_dir)_debug" >$(NUL) 2>$(NUL))
@echo Created $(work_dir)_release and ..._debug directories
@echo Created the $(work_dir)_release directory

info:
@echo OS: $(tbb_os)
@echo arch=$(arch)
@echo compiler=$(compiler)
@echo runtime=$(runtime)
@echo tbb_build_prefix=$(tbb_build_prefix)

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

Threading Building Blocks (TBB) lets you easily write parallel C++ programs that take
@@ -0,0 +1,69 @@
# Copyright (c) 2005-2019 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

#------------------------------------------------------------------------------
# Define rules for making the tbbbind shared library.
#------------------------------------------------------------------------------

tbb_root ?= "$(TBBROOT)"
BUILDING_PHASE=1
include $(tbb_root)/build/common.inc
CPLUS_FLAGS += $(SDL_FLAGS)
DEBUG_SUFFIX=$(findstring _debug,_$(cfg))

#------------------------------------------------------------
# Define static pattern rules dealing with .cpp source files
#------------------------------------------------------------
$(warning CONFIG: cfg=$(cfg) arch=$(arch) compiler=$(compiler) target=$(target) runtime=$(runtime))

.PHONY: tbbbind
.PRECIOUS: %.$(OBJ)

VPATH = $(tbb_root)/src/tbb/$(ASSEMBLY_SOURCE) $(tbb_root)/src/tbb $(tbb_root)/src/old $(tbb_root)/src/rml/client

CPLUS_FLAGS += $(PIC_KEY) $(DSE_KEY)

# Suppress superfluous warnings for tbbbind compilation
WARNING_KEY += $(WARNING_SUPPRESS)

include $(tbb_root)/build/common_rules.inc

TBBBIND.OBJ = tbbbind.$(OBJ)

ifneq (,$(TBBBIND.DEF))
tbbbind.def: $(TBBBIND.DEF)
$(CPLUS) $(PREPROC_ONLY) $< $(CPLUS_FLAGS) $(INCLUDES) > $@

LIB_LINK_FLAGS += $(EXPORT_KEY)tbbbind.def
$(TBBBIND.DLL): tbbbind.def
endif

ifneq (,$(TBBBIND.DLL))
$(TBBBIND.DLL): BUILDING_LIBRARY = $(TBBBIND.DLL)
$(TBBBIND.DLL): $(TBBBIND.OBJ) $(TBBBIND_NO_VERSION.DLL)
$(LIB_LINK_CMD) $(LIB_OUTPUT_KEY)$(TBBBIND.DLL) $(TBBBIND.OBJ) $(HWLOC.LIB) $(LINK_TBB.LIB) $(LIB_LINK_FLAGS)
endif

ifneq (,$(TBBBIND_NO_VERSION.DLL))
$(TBBBIND_NO_VERSION.DLL):
echo "INPUT ($(TBBBIND.DLL))" > $(TBBBIND_NO_VERSION.DLL)
endif

tbbbind: $(TBB.DLL) $(TBBBIND.DLL)

#clean:
# $(RM) *.$(OBJ) *.$(DLL) *.res *.map *.ilk *.pdb *.exp *.manifest *.tmp *.d core core.*[0-9][0-9] *.ver

# Include automatically generated dependencies
-include *.d
@@ -252,6 +252,8 @@ endif

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

test_arena_constraints_hwloc.$(TEST_EXT): LIBS += $(HWLOC.LIB)

$(TEST_TBB_PLAIN.EXE) $(TEST_TBB_SPECIAL.EXE): WARNING_KEY += $(TEST_WARNING_KEY)

# Run tests that are in SCHEDULER_DIRECTLY_INCLUDED and TEST_TBB_PLAIN.EXE but not in skip_tests (which is specified by user)
@@ -18,6 +18,9 @@ <H2>Files</H2>
<DT><A HREF="Makefile.tbbmalloc">Makefile.tbbmalloc</A>
<DD>Main Makefile to build the Intel TBB scalable memory allocator library as well as its tests.
Invoked via 'make tbbmalloc' from <A HREF="../Makefile">top-level Makefile</A>.
<DT><A HREF="Makefile.tbbbind">Makefile.tbbbind</A>
<DD>Main Makefile to build the tbbbind library.
Invoked via 'make tbbbind' from <A HREF="../Makefile">top-level Makefile</A>
<DT><A HREF="Makefile.test">Makefile.test</A>
<DD>Main Makefile to build and run the tests for the Intel TBB library.
Invoked via 'make test' from <A HREF="../Makefile">top-level Makefile</A>.
@@ -73,7 +76,7 @@ <H3>Software prerequisites:</H3>
<LI>Explicitly specify the architecture when invoking GNU make, e.g. <TT>make arch=ia32</TT>.
</OL>

<P>The default make target will build the release and debug versions of the Intel TBB library.</P>
<P>The default make target will build the release version of the Intel TBB library.</P>
<P>Other targets are available in the top-level Makefile. You might find the following targets useful:
<UL>
<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>
<DT><TT>cd src;make debug</TT>
<DD>Build and test debug libraries only.
<DT><TT>make tbb</TT>
<DD>Make Intel TBB release and debug libraries.
<DD>Make Intel TBB release libraries.
<DT><TT>make tbbmalloc</TT>
<DD>Make Intel TBB scalable memory allocator libraries.
<DT><TT>make tbbbind</TT>
<DD>Make the tbbbind library.
<DT><TT>make test</TT>
<DD>Compile and run unit-tests
<DT><TT>make examples</TT>
<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>.
<DD>Build libraries and run all examples, like doing <TT>make clean release</TT> from <A HREF="../examples/Makefile">the general example Makefile</A>.
Available in the open-source version only.
<DT><TT>make python</TT>
<DD>Build, install, and test Python* API for Intel TBB. See <A HREF="../python/index.html">details here</A>.
@@ -116,6 +116,13 @@ TBB.LIB = $(TBB.DLL)
TBB_NO_VERSION.DLL=libtbb$(CPF_SUFFIX)$(DEBUG_SUFFIX).$(DLL)
LINK_TBB.LIB = $(TBB_NO_VERSION.DLL)

TBBBIND_NO_VERSION.DLL = libtbbbind$(DEBUG_SUFFIX).$(DLL)
TBBBIND.DEF = $(tbb_root)/src/tbb/$(def_prefix)-tbbbind-export.def
TBBBIND.DLL = $(TBBBIND_NO_VERSION.DLL).$(SONAME_SUFFIX)
TBBBIND.LIB = $(TBBBIND_NO_VERSION.DLL)
LINK_TBBBIND.LIB = $(TBBBIND.LIB)
HWLOC.LIB = -lhwloc

MALLOC_NO_VERSION.DLL = libtbbmalloc$(DEBUG_SUFFIX).$(MALLOC_DLL)
MALLOC.DEF = $(MALLOC_ROOT)/$(def_prefix)-tbbmalloc-export.def
MALLOC.DLL = $(MALLOC_NO_VERSION.DLL).$(SONAME_SUFFIX)
@@ -79,6 +79,13 @@ ifneq ($(filter vc8 vc9,$(runtime)),)
TBB.MANIFEST = tbbmanifest.exe.manifest
endif

TBBBIND.DEF = $(tbb_root)/src/tbb/$(def_prefix)-tbbbind-export.def
TBBBIND.DLL = tbbbind$(DEBUG_SUFFIX).$(DLL)
TBBBIND.LIB = tbbbind$(DEBUG_SUFFIX).$(LIBEXT)
TBBBIND.RES = tbbbind.res
LINK_TBBBIND.LIB = $(TBBBIND.LIB)
HWLOC.LIB = libhwloc.$(LIBEXT)

MALLOC.DEF = $(MALLOC_ROOT)/$(def_prefix)-tbbmalloc-export.def
MALLOC.DLL = tbbmalloc$(DEBUG_SUFFIX).$(DLL)
MALLOC.LIB = tbbmalloc$(DEBUG_SUFFIX).$(LIBEXT)
@@ -197,6 +197,7 @@ If ``tbbmalloc_proxy`` is requested, ``tbbmalloc`` component will also be added
TBBConfig creates `imported targets <https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#imported-targets>`_ as
shared libraries using the following format: ``TBB::<component>`` (for example, ``TBB::tbb``, ``TBB::tbbmalloc``).

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.
Variables set during TBB configuration:

========================= ================================================
@@ -47,14 +47,20 @@ unset(_tbbmalloc_proxy_ix)
foreach (_tbb_component ${TBB_FIND_COMPONENTS})
set(TBB_${_tbb_component}_FOUND 0)

set(_tbb_release_lib "${CMAKE_CURRENT_LIST_DIR}/@TBB_LIB_REL_PATH@/@TBB_LIB_PREFIX@${_tbb_component}.@TBB_LIB_EXT@")
set(_tbb_debug_lib "${CMAKE_CURRENT_LIST_DIR}/@TBB_LIB_REL_PATH@/@TBB_LIB_PREFIX@${_tbb_component}_debug.@TBB_LIB_EXT@")
get_filename_component(_tbb_release_lib "${CMAKE_CURRENT_LIST_DIR}/@TBB_LIB_REL_PATH@/@TBB_LIB_PREFIX@${_tbb_component}.@TBB_LIB_EXT@" ABSOLUTE)

if (NOT TBB_FIND_RELEASE_ONLY)
get_filename_component(_tbb_debug_lib "${CMAKE_CURRENT_LIST_DIR}/@TBB_LIB_REL_PATH@/@TBB_LIB_PREFIX@${_tbb_component}_debug.@TBB_LIB_EXT@" ABSOLUTE)
endif()

if (EXISTS "${_tbb_release_lib}" OR EXISTS "${_tbb_debug_lib}")
if (NOT TARGET TBB::${_tbb_component})
add_library(TBB::${_tbb_component} SHARED IMPORTED)

get_filename_component(_tbb_include_dir "${CMAKE_CURRENT_LIST_DIR}/@TBB_INC_REL_PATH@" ABSOLUTE)
set_target_properties(TBB::${_tbb_component} PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_LIST_DIR}/@TBB_INC_REL_PATH@")
INTERFACE_INCLUDE_DIRECTORIES "${_tbb_include_dir}")
unset(_tbb_include_dir)

if (EXISTS "${_tbb_release_lib}")
set_target_properties(TBB::${_tbb_component} PROPERTIES
@@ -72,14 +78,16 @@ foreach (_tbb_component ${TBB_FIND_COMPONENTS})
if (_tbb_component STREQUAL tbbmalloc_proxy)
set_target_properties(TBB::tbbmalloc_proxy PROPERTIES INTERFACE_LINK_LIBRARIES TBB::tbbmalloc)
endif()
else()
message(STATUS "Using previously found TBB::${_tbb_component}")
endif()
list(APPEND TBB_IMPORTED_TARGETS TBB::${_tbb_component})
set(TBB_${_tbb_component}_FOUND 1)
elseif (TBB_FIND_REQUIRED AND TBB_FIND_REQUIRED_${_tbb_component})
message(STATUS "Missed required Intel TBB component: ${_tbb_component}")
message(STATUS " one or both of:\n ${_tbb_release_lib}\n ${_tbb_debug_lib}\n files must exist.")
if (TBB_FIND_RELEASE_ONLY)
message(STATUS " ${_tbb_release_lib} must exist.")
else()
message(STATUS " one or both of:\n ${_tbb_release_lib}\n ${_tbb_debug_lib}\n files must exist.")
endif()
set(TBB_FOUND FALSE)
endif()
endforeach()
@@ -49,7 +49,10 @@ foreach (_tbb_component ${TBB_FIND_COMPONENTS})
set(TBB_${_tbb_component}_FOUND 0)

set(_tbb_release_lib "@TBB_RELEASE_LIB_PATH@/@TBB_LIB_PREFIX@${_tbb_component}.@TBB_LIB_EXT@")
set(_tbb_debug_lib "@TBB_DEBUG_LIB_PATH@/@TBB_LIB_PREFIX@${_tbb_component}_debug.@TBB_LIB_EXT@")

if (NOT TBB_FIND_RELEASE_ONLY)
set(_tbb_debug_lib "@TBB_DEBUG_LIB_PATH@/@TBB_LIB_PREFIX@${_tbb_component}_debug.@TBB_LIB_EXT@")
endif()

if (EXISTS "${_tbb_release_lib}" OR EXISTS "${_tbb_debug_lib}")
if (NOT TARGET TBB::${_tbb_component})
@@ -73,14 +76,16 @@ foreach (_tbb_component ${TBB_FIND_COMPONENTS})
if (_tbb_component STREQUAL tbbmalloc_proxy)
set_target_properties(TBB::tbbmalloc_proxy PROPERTIES INTERFACE_LINK_LIBRARIES TBB::tbbmalloc)
endif()
else()
message(STATUS "Using previously found TBB::${_tbb_component}")
endif()
list(APPEND TBB_IMPORTED_TARGETS TBB::${_tbb_component})
set(TBB_${_tbb_component}_FOUND 1)
elseif (TBB_FIND_REQUIRED AND TBB_FIND_REQUIRED_${_tbb_component})
message(STATUS "Missed required Intel TBB component: ${_tbb_component}")
message(STATUS " one or both of:\n ${_tbb_release_lib}\n ${_tbb_debug_lib}\n files must exist.")
if (TBB_FIND_RELEASE_ONLY)
message(STATUS " ${_tbb_release_lib} must exist.")
else()
message(STATUS " one or both of:\n ${_tbb_release_lib}\n ${_tbb_debug_lib}\n files must exist.")
endif()
set(TBB_FOUND FALSE)
endif()
endforeach()

0 comments on commit 1807034

Please sign in to comment.
You can’t perform that action at this time.