Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ Thumbs.db
################################
CMakeCache.txt
CMakeFiles/
cmake/TBBConfig.cmake
cmake/TBBConfigVersion.cmake

*.cmake
libtbb.dylib
Expand Down
25 changes: 25 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,31 @@
The list of most significant changes made over time in
Intel(R) Threading Building Blocks (Intel(R) TBB).

Intel TBB 2020 Update 3
TBB_INTERFACE_VERSION == 11103

Changes (w.r.t. Intel TBB 2020 Update 2):

Changes affecting backward compatibility:

- Changed body type concept of the flow::input_node.
Set TBB_DEPRECATED_INPUT_NODE_BODY to 1 to compile with the previous
concept of the body type.

Bugs fixed:

- Fixed compilation errors in C++20 mode due to ambiguity of comparison
operators. Inspired by Barry Revzin
(https://github.com/oneapi-src/oneTBB/pull/251).

Open-source contributions integrated:

- Fixed an issue in TBBBuild.cmake that causes the build with no arguments
to fail (https://github.com/oneapi-src/oneTBB/pull/233) by tttapa.
- Added cmake/{TBBConfig,TBBConfigVersion}.cmake to Git ignore list
(https://github.com/oneapi-src/oneTBB/pull/239) by Eisuke Kawashima.

------------------------------------------------------------------------
Intel TBB 2020 Update 2
TBB_INTERFACE_VERSION == 11102

Expand Down
21 changes: 14 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -248,14 +248,21 @@ if (MSVC)
COMMENT "Preprocessing tbbmalloc.def"
)
else()

if (APPLE)
list(GET CMAKE_OSX_ARCHITECTURES 0 TARGET_ARCH)
set(ARCH_COMPILER_OPTION -arch ${TARGET_ARCH})
set(STDLIB_COMPILER_OPTION -stdlib=libc++)
endif(APPLE)

add_custom_command(OUTPUT tbb.def
COMMAND ${CMAKE_CXX_COMPILER} -xc++ -std=c++11 -E ${CMAKE_CURRENT_SOURCE_DIR}/src/tbb/${ARCH_PREFIX}-tbb-export.def -I ${CMAKE_CURRENT_SOURCE_DIR}/include -o tbb.def
COMMAND ${CMAKE_CXX_COMPILER} ${ARCH_COMPILER_OPTION} ${STDLIB_COMPILER_OPTION} -xc++ -std=c++11 -E ${CMAKE_CURRENT_SOURCE_DIR}/src/tbb/${ARCH_PREFIX}-tbb-export.def -I ${CMAKE_CURRENT_SOURCE_DIR}/include -o tbb.def
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/src/tbb/${ARCH_PREFIX}-tbb-export.def
COMMENT "Preprocessing tbb.def"
)

add_custom_command(OUTPUT tbbmalloc.def
COMMAND ${CMAKE_CXX_COMPILER} -xc++ -std=c++11 -E ${CMAKE_CURRENT_SOURCE_DIR}/src/tbbmalloc/${ARCH_PREFIX}-tbbmalloc-export.def -I ${CMAKE_CURRENT_SOURCE_DIR}/include -o tbbmalloc.def
COMMAND ${CMAKE_CXX_COMPILER} ${ARCH_COMPILER_OPTION} ${STDLIB_COMPILER_OPTION} -xc++ -std=c++11 -E ${CMAKE_CURRENT_SOURCE_DIR}/src/tbbmalloc/${ARCH_PREFIX}-tbbmalloc-export.def -I ${CMAKE_CURRENT_SOURCE_DIR}/include -o tbbmalloc.def
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/src/tbbmalloc/${ARCH_PREFIX}-tbbmalloc-export.def
COMMENT "Preprocessing tbbmalloc.def"
)
Expand All @@ -281,7 +288,7 @@ if (TBB_BUILD_STATIC)

if (MSVC)
target_compile_definitions(tbb_static
PUBLIC -D__TBB_NO_IMPLICIT_LINKAGE=1
PUBLIC -D__TBB_IMPLICIT_LINKAGE=0
PRIVATE -D_CRT_SECURE_NO_WARNINGS)
endif()

Expand All @@ -304,7 +311,7 @@ if (TBB_BUILD_SHARED)

if (MSVC)
target_compile_definitions(tbb
PUBLIC -D__TBB_NO_IMPLICIT_LINKAGE=1
PUBLIC -D__TBB_IMPLICIT_LINKAGE=0
PRIVATE -D_CRT_SECURE_NO_WARNINGS)
endif()

Expand Down Expand Up @@ -355,7 +362,7 @@ if(TBB_BUILD_TBBMALLOC)
set_property(TARGET tbbmalloc_static APPEND PROPERTY COMPILE_DEFINITIONS "__TBB_SOURCE_DIRECTLY_INCLUDED=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)
target_compile_definitions(tbbmalloc_static PUBLIC __TBB_IMPLICIT_LINKAGE=0 __TBBMALLOC_NO_IMPLICIT_LINKAGE=1)
endif()
if (TBB_INSTALL_TARGETS)
install(TARGETS tbbmalloc_static ARCHIVE DESTINATION ${TBB_INSTALL_ARCHIVE_DIR})
Expand All @@ -379,7 +386,7 @@ if(TBB_BUILD_TBBMALLOC)
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)
target_compile_definitions(tbbmalloc PUBLIC __TBB_IMPLICIT_LINKAGE=0 __TBBMALLOC_NO_IMPLICIT_LINKAGE=1)
endif()
if (TBB_INSTALL_TARGETS)
install(TARGETS tbbmalloc EXPORT TBB
Expand Down Expand Up @@ -615,7 +622,7 @@ if (TBB_BUILD_TESTS)
tbb_add_test (source_node)
tbb_add_test (split_node)
tbb_add_test (static_assert)
tbb_add_test (std_thread)
# tbb_add_test (std_thread) # Fails to compile on macOS - deprecated anyway
tbb_add_test (tagged_msg)
# tbb_add_test (task_arena) # LINK : fatal error LNK1104: cannot open file '__TBB_LIB_NAME.lib' [C:\projects\tbb\test_task_arena.vcxproj]
# tbb_add_test (task_assertions)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### Intel(R) Threading Building Blocks

[![Stable release](https://img.shields.io/badge/version-2020.2-green.svg)](https://github.com/01org/tbb/releases/tag/v2020.2)
[![Stable release](https://img.shields.io/badge/version-2020.3-green.svg)](https://github.com/01org/tbb/releases/tag/v2020.3)
[![Apache License Version 2.0](https://img.shields.io/badge/license-Apache_2.0-green.svg)](LICENSE)
[![Build Status](https://travis-ci.org/wjakob/tbb.svg?branch=master)](https://travis-ci.org/wjakob/tbb)
[![Build status](https://ci.appveyor.com/api/projects/status/fvepmk5nxekq27r8?svg=true)](https://ci.appveyor.com/project/wjakob/tbb/branch/master)
Expand Down
2 changes: 1 addition & 1 deletion build/Makefile.rml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ endif

# Suppress superfluous warnings for RML compilation
R_CPLUS_FLAGS = $(subst DO_ITT_NOTIFY,DO_ITT_NOTIFY=0,$(CPLUS_FLAGS)) $(WARNING_SUPPRESS) \
$(DEFINE_KEY)TBB_USE_THREADING_TOOLS=0 $(DEFINE_KEY)__TBB_RML_STATIC=1 $(DEFINE_KEY)__TBB_NO_IMPLICIT_LINKAGE=1
$(DEFINE_KEY)TBB_USE_THREADING_TOOLS=0 $(DEFINE_KEY)__TBB_RML_STATIC=1 $(DEFINE_KEY)__TBB_IMPLICIT_LINKAGE=0

%.$(OBJ): %.cpp
$(CPLUS) $(COMPILE_ONLY) $(R_CPLUS_FLAGS) $(PIC_KEY) $(DSE_KEY) $(INCLUDES) $<
Expand Down
2 changes: 1 addition & 1 deletion build/Makefile.test
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ DEBUG_SUFFIX=$(findstring _debug,$(call cross_cfg,_$(cfg)))
#------------------------------------------------------------

VPATH = $(tbb_root)/src/tbb/$(ASSEMBLY_SOURCE) $(tbb_root)/src/tbb $(tbb_root)/src/rml/client $(tbb_root)/src/old $(tbb_root)/src/test $(tbb_root)/src/perf
CPLUS_FLAGS += $(if $(crosstest),$(DEFINE_KEY)__TBB_NO_IMPLICIT_LINKAGE=1) \
CPLUS_FLAGS += $(if $(crosstest),$(DEFINE_KEY)__TBB_IMPLICIT_LINKAGE=0) \
$(if $(no_exceptions),$(DEFINE_KEY)__TBB_TEST_NO_EXCEPTIONS=1) \
$(if $(LINK_TBB.LIB),$(DEFINE_KEY)TEST_USES_TBB=1)

Expand Down
8 changes: 7 additions & 1 deletion include/tbb/concurrent_vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,12 @@ class concurrent_vector: protected internal::allocator_base<T, A>,

#endif

#if !defined(_MSC_VER)
#define CONCURRENT_VECTOR_COPY_CONSTRUCT_FROM_OTHER_ALLOCATOR
#endif

// This deprecated function declaration causes a compiler error in Visual Studio 2017
#if defined(CONCURRENT_VECTOR_COPY_CONSTRUCT_FROM_OTHER_ALLOCATOR)
//! Copying constructor for vector with different allocator type
template<class M>
__TBB_DEPRECATED concurrent_vector( const concurrent_vector<T, M>& vector, const allocator_type& a = allocator_type() )
Expand All @@ -689,7 +695,7 @@ class concurrent_vector: protected internal::allocator_base<T, A>,
__TBB_RETHROW();
}
}

#endif
//! Construction with initial size specified by argument n
explicit concurrent_vector(size_type n)
{
Expand Down
28 changes: 18 additions & 10 deletions include/tbb/flow_graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "task.h"
#include "cache_aligned_allocator.h"
#include "tbb_exception.h"
#include "pipeline.h"
#include "internal/_template_helpers.h"
#include "internal/_aggregator_impl.h"
#include "tbb/internal/_allocator_traits.h"
Expand Down Expand Up @@ -920,12 +921,12 @@ class input_node : public graph_node, public sender< Output > {
template< typename Body >
__TBB_NOINLINE_SYM input_node( graph &g, Body body )
: graph_node(g), my_active(false),
my_body( new internal::source_body_leaf< output_type, Body>(body) ),
my_init_body( new internal::source_body_leaf< output_type, Body>(body) ),
my_body( new internal::input_body_leaf< output_type, Body>(body) ),
my_init_body( new internal::input_body_leaf< output_type, Body>(body) ),
my_reserved(false), my_has_cached_item(false)
{
my_successors.set_owner(this);
tbb::internal::fgt_node_with_body( CODEPTR(), tbb::internal::FLOW_SOURCE_NODE, &this->my_graph,
tbb::internal::fgt_node_with_body( CODEPTR(), tbb::internal::FLOW_SOURCE_NODE, &this->my_graph,
static_cast<sender<output_type> *>(this), this->my_body );
}

Expand Down Expand Up @@ -1066,8 +1067,8 @@ class input_node : public graph_node, public sender< Output > {

template<typename Body>
Body copy_function_object() {
internal::source_body<output_type> &body_ref = *this->my_body;
return dynamic_cast< internal::source_body_leaf<output_type, Body> & >(body_ref).get_body();
internal::input_body<output_type> &body_ref = *this->my_body;
return dynamic_cast< internal::input_body_leaf<output_type, Body> & >(body_ref).get_body();
}

#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
Expand All @@ -1081,15 +1082,15 @@ class input_node : public graph_node, public sender< Output > {

protected:

//! resets the source_node to its initial state
//! resets the input_node to its initial state
void reset_node( reset_flags f) __TBB_override {
my_active = false;
my_reserved = false;
my_has_cached_item = false;

if(f & rf_clear_edges) my_successors.clear();
if(f & rf_reset_bodies) {
internal::source_body<output_type> *tmp = my_init_body->clone();
internal::input_body<output_type> *tmp = my_init_body->clone();
delete my_body;
my_body = tmp;
}
Expand All @@ -1098,8 +1099,8 @@ class input_node : public graph_node, public sender< Output > {
private:
spin_mutex my_mutex;
bool my_active;
internal::source_body<output_type> *my_body;
internal::source_body<output_type> *my_init_body;
internal::input_body<output_type> *my_body;
internal::input_body<output_type> *my_init_body;
internal::broadcast_cache< output_type > my_successors;
bool my_reserved;
bool my_has_cached_item;
Expand All @@ -1113,11 +1114,18 @@ class input_node : public graph_node, public sender< Output > {
}
if ( !my_has_cached_item ) {
tbb::internal::fgt_begin_body( my_body );

#if TBB_DEPRECATED_INPUT_NODE_BODY
bool r = (*my_body)(my_cached_item);
tbb::internal::fgt_end_body( my_body );
if (r) {
my_has_cached_item = true;
}
#else
flow_control control;
my_cached_item = (*my_body)(control);
my_has_cached_item = !control.is_pipeline_stopped;
#endif
tbb::internal::fgt_end_body( my_body );
}
if ( my_has_cached_item ) {
v = my_cached_item;
Expand Down
60 changes: 59 additions & 1 deletion include/tbb/internal/_flow_graph_body_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#ifndef __TBB__flow_graph_body_impl_H
#define __TBB__flow_graph_body_impl_H

#include "tbb/internal/_template_helpers.h"

#ifndef __TBB_flow_graph_H
#error Do not #include this internal file directly; use public TBB headers instead.
#endif
Expand Down Expand Up @@ -90,8 +92,61 @@ namespace graph_policy_namespace {
} // namespace graph_policy_namespace

// -------------- function_body containers ----------------------

//! A functor that takes no input and generates a value of type Output
template< typename Output >
class input_body : tbb::internal::no_assign {
public:
virtual ~input_body() {}

#if TBB_DEPRECATED_INPUT_NODE_BODY
virtual bool operator()(Output &output) = 0;
#else
virtual Output operator()(flow_control& fc) = 0;
#endif
virtual input_body* clone() = 0;
};

template <typename Body>
void check_input_node_body_input_type_impl(Body) {
__TBB_STATIC_ASSERT((tbb::internal::is_same_type<typename tbb::internal::body_arg_detector<Body>::arg_type, flow_control&>::value),
"TBB Warning: input_node body requirements have been changed."
"To temporarily enforce deprecated API specify TBB_DEPRECATED_INPUT_NODE_BODY.");
}

template <typename Body>
void check_input_node_body_input_type(Body) {
check_input_node_body_input_type_impl(&Body::operator());
}

template <typename ReturnType, typename T>
void check_input_node_body_input_type(ReturnType(*)(T)) {
__TBB_STATIC_ASSERT((tbb::internal::is_same_type<T, flow_control&>::value),
"TBB Warning: input_node body requirements have been changed."
"To temporarily enforce deprecated API specify TBB_DEPRECATED_INPUT_NODE_BODY.");
}

//! The leaf for input_body
template< typename Output, typename Body>
class input_body_leaf : public input_body<Output> {
public:
input_body_leaf( const Body &_body ) : body(_body) { }

#if TBB_DEPRECATED_INPUT_NODE_BODY
bool operator()(Output &output) __TBB_override { return body( output ); }
#else
Output operator()(flow_control& fc) __TBB_override {
check_input_node_body_input_type(body);
return body(fc);
}
#endif
input_body_leaf* clone() __TBB_override {
return new input_body_leaf< Output, Body >(body);
}
Body get_body() { return body; }
private:
Body body;
};

template< typename Output >
class source_body : tbb::internal::no_assign {
public:
Expand All @@ -105,10 +160,13 @@ template< typename Output, typename Body>
class source_body_leaf : public source_body<Output> {
public:
source_body_leaf( const Body &_body ) : body(_body) { }

bool operator()(Output &output) __TBB_override { return body( output ); }

source_body_leaf* clone() __TBB_override {
return new source_body_leaf< Output, Body >(body);
}

Body get_body() { return body; }
private:
Body body;
Expand Down
10 changes: 5 additions & 5 deletions include/tbb/internal/_flow_graph_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -292,11 +292,11 @@ class graph : tbb::internal::no_copy, public tbb::flow::graph_proxy {
void set_name(const char *name);
#endif

void increment_wait_count() {
__TBB_DEPRECATED void increment_wait_count() {
reserve_wait();
}

void decrement_wait_count() {
__TBB_DEPRECATED void decrement_wait_count() {
release_wait();
}

Expand All @@ -314,7 +314,7 @@ class graph : tbb::internal::no_copy, public tbb::flow::graph_proxy {
/** The task is spawned as a child of the graph. This is useful for running tasks
that need to block a wait_for_all() on the graph. For example a one-off source. */
template< typename Receiver, typename Body >
void run(Receiver &r, Body body) {
__TBB_DEPRECATED void run(Receiver &r, Body body) {
if (tbb::flow::interface11::internal::is_graph_active(*this)) {
task* rtask = new (task::allocate_additional_child_of(*root_task()))
run_and_put_task< Receiver, Body >(r, body);
Expand All @@ -326,7 +326,7 @@ class graph : tbb::internal::no_copy, public tbb::flow::graph_proxy {
/** The task is spawned as a child of the graph. This is useful for running tasks
that need to block a wait_for_all() on the graph. For example a one-off source. */
template< typename Body >
void run(Body body) {
__TBB_DEPRECATED void run(Body body) {
if (tbb::flow::interface11::internal::is_graph_active(*this)) {
task* rtask = new (task::allocate_additional_child_of(*root_task())) run_task< Body >(body);
my_task_arena->execute(spawn_functor(*rtask));
Expand Down Expand Up @@ -371,7 +371,7 @@ class graph : tbb::internal::no_copy, public tbb::flow::graph_proxy {
}

//! Returns the root task of the graph
tbb::task * root_task() {
__TBB_DEPRECATED tbb::task * root_task() {
return my_root_task;
}

Expand Down
Loading