Skip to content

Commit

Permalink
Committing TBB 2020 Update 2 source code
Browse files Browse the repository at this point in the history
  • Loading branch information
tbbdev committed Mar 30, 2020
1 parent 427c252 commit 60b7d0a
Show file tree
Hide file tree
Showing 62 changed files with 1,352 additions and 463 deletions.
20 changes: 20 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,26 @@
The list of most significant changes made over time in
Intel(R) Threading Building Blocks (Intel(R) TBB).

Intel TBB 2020 Update 2
TBB_INTERFACE_VERSION == 11102

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

- Cross-allocator copying constructor and copy assignment operator for
concurrent_vector are deprecated.
- Added input_node to the flow graph API. It acts like a source_node
except for being inactive by default; source_node is deprecated.
- Allocator template parameter for flow graph nodes is deprecated. Set
TBB_DEPRECATED_FLOW_NODE_ALLOCATOR to 1 to avoid compilation errors.
- Flow graph preview hetero-features are deprecated.

Bugs fixed:

- Fixed the task affinity mechanism to prevent unlimited memory
consumption in case the number of threads is explicitly decreased.
- Fixed memory leak related NUMA support functionality in task_arena.

------------------------------------------------------------------------
Intel TBB 2020 Update 1
TBB_INTERFACE_VERSION == 11101

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Threading Building Blocks 2020
[![Stable release](https://img.shields.io/badge/version-2020.1-green.svg)](https://github.com/intel/tbb/releases/tag/v2020.1)
[![Stable release](https://img.shields.io/badge/version-2020.2-green.svg)](https://github.com/intel/tbb/releases/tag/v2020.2)
[![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
Expand Down
1 change: 1 addition & 0 deletions build/Makefile.test
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ TEST_TBB_PLAIN.EXE = test_assembly.$(TEST_EXT) \
test_priority_queue_node.$(TEST_EXT) \
test_sequencer_node.$(TEST_EXT) \
test_source_node.$(TEST_EXT) \
test_input_node.$(TEST_EXT) \
test_overwrite_node.$(TEST_EXT) \
test_write_once_node.$(TEST_EXT) \
test_indexer_node.$(TEST_EXT) \
Expand Down
4 changes: 3 additions & 1 deletion cmake/templates/TBBConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,11 @@ foreach (_tbb_component ${TBB_FIND_COMPONENTS})
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)
get_filename_component(_tbb_current_realpath "${CMAKE_CURRENT_LIST_DIR}" REALPATH)
get_filename_component(_tbb_include_dir "${_tbb_current_realpath}/@TBB_INC_REL_PATH@" ABSOLUTE)
set_target_properties(TBB::${_tbb_component} PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${_tbb_include_dir}")
unset(_tbb_current_realpath)
unset(_tbb_include_dir)

if (EXISTS "${_tbb_release_lib}")
Expand Down
4 changes: 2 additions & 2 deletions examples/graph/binpack/binpack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ typedef buffer_node<bin> bin_buffer;
// Packed bins are taken from the_bin_buffer and processed by the_writer:
typedef function_node<bin, continue_msg, rejecting> bin_writer;
// Items are injected into the graph when this node sends them to the_value_pool:
typedef source_node<value_type> value_source;
typedef input_node<value_type> value_source;

// User-specified globals with default values
size_type V = 42; // desired capacity for each bin
Expand Down Expand Up @@ -259,7 +259,7 @@ int main(int argc, char *argv[]) {
<< optimality << ", " << num_bin_packers << " bins of capacity=" << V << " on " << p
<< " threads.\n";
graph g;
value_source the_source(g, item_generator(), false);
value_source the_source(g, item_generator());
value_pool the_value_pool(g);
make_edge(the_source, the_value_pool);
bin_buffer the_bin_buffer(g);
Expand Down
3 changes: 2 additions & 1 deletion examples/graph/fgbzip2/fgbzip2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ void fgCompressionAsyncMsg(IOOperations& io, int blockSizeIn100KB, size_t memory
void fgCompression(IOOperations& io, int blockSizeIn100KB) {
tbb::flow::graph g;

tbb::flow::source_node< BufferMsg > file_reader(g, [&io](BufferMsg& bufferMsg)->bool {
tbb::flow::input_node< BufferMsg > file_reader(g, [&io](BufferMsg& bufferMsg)->bool {
if (io.hasDataToRead()) {
bufferMsg = BufferMsg::createBufferMsg(io.chunksRead(), io.chunkSize());
io.readChunk(bufferMsg.inputBuffer);
Expand All @@ -402,6 +402,7 @@ void fgCompression(IOOperations& io, int blockSizeIn100KB) {
make_edge(compressor, ordering);
make_edge(ordering, output_writer);

file_reader.activate();
g.wait_for_all();
}

Expand Down
8 changes: 4 additions & 4 deletions examples/graph/logic_sim/basics.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,25 +188,25 @@ class pulse {
graph& my_graph;
size_t ms, init_ms;
int reps, init_reps;
source_node<signal_t> clock_node;
input_node<signal_t> clock_node;

public:
pulse(graph& g, size_t _ms=1000, int _reps=-1) :
my_graph(g), ms(_ms), init_ms(_ms), reps(_reps), init_reps(_reps),
clock_node(g, clock_body(ms, reps), false)
clock_node(g, clock_body(ms, reps))
{}
pulse(const pulse& src) :
my_graph(src.my_graph), ms(src.init_ms), init_ms(src.init_ms),
reps(src.init_reps), init_reps(src.init_reps),
clock_node(src.my_graph, clock_body(ms, reps), false)
clock_node(src.my_graph, clock_body(ms, reps))
{}
~pulse() {}
// Assignment changes the behavior of LHS to that of the RHS, but doesn't change owning graph
pulse& operator=(const pulse& src) {
ms = src.ms; init_ms = src.init_ms; reps = src.reps; init_reps = src.init_reps;
return *this;
}
source_node<signal_t>& get_out() { return clock_node; }
input_node<signal_t>& get_out() { return clock_node; }
void activate() { clock_node.activate(); }
void reset() { reps = init_reps; }
};
Expand Down
30 changes: 15 additions & 15 deletions include/serial/tbb/parallel_for.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,35 +105,35 @@ void start_for< Range, Body, Partitioner >::execute() {
//! Parallel iteration over range with default partitioner.
/** @ingroup algorithms **/
template<typename Range, typename Body>
__TBB_DEPRECATED_VERBOSE void parallel_for( const Range& range, const Body& body ) {
__TBB_DEPRECATED_IN_VERBOSE_MODE void parallel_for( const Range& range, const Body& body ) {
serial::interface9::start_for<Range,Body,const __TBB_DEFAULT_PARTITIONER>::run(range,body,__TBB_DEFAULT_PARTITIONER());
}

//! Parallel iteration over range with simple partitioner.
/** @ingroup algorithms **/
template<typename Range, typename Body>
__TBB_DEPRECATED_VERBOSE void parallel_for( const Range& range, const Body& body, const simple_partitioner& partitioner ) {
__TBB_DEPRECATED_IN_VERBOSE_MODE void parallel_for( const Range& range, const Body& body, const simple_partitioner& partitioner ) {
serial::interface9::start_for<Range,Body,const simple_partitioner>::run(range,body,partitioner);
}

//! Parallel iteration over range with auto_partitioner.
/** @ingroup algorithms **/
template<typename Range, typename Body>
__TBB_DEPRECATED_VERBOSE void parallel_for( const Range& range, const Body& body, const auto_partitioner& partitioner ) {
__TBB_DEPRECATED_IN_VERBOSE_MODE void parallel_for( const Range& range, const Body& body, const auto_partitioner& partitioner ) {
serial::interface9::start_for<Range,Body,const auto_partitioner>::run(range,body,partitioner);
}

//! Parallel iteration over range with static_partitioner.
/** @ingroup algorithms **/
template<typename Range, typename Body>
__TBB_DEPRECATED_VERBOSE void parallel_for( const Range& range, const Body& body, const static_partitioner& partitioner ) {
__TBB_DEPRECATED_IN_VERBOSE_MODE void parallel_for( const Range& range, const Body& body, const static_partitioner& partitioner ) {
serial::interface9::start_for<Range,Body,const static_partitioner>::run(range,body,partitioner);
}

//! Parallel iteration over range with affinity_partitioner.
/** @ingroup algorithms **/
template<typename Range, typename Body>
__TBB_DEPRECATED_VERBOSE void parallel_for( const Range& range, const Body& body, affinity_partitioner& partitioner ) {
__TBB_DEPRECATED_IN_VERBOSE_MODE void parallel_for( const Range& range, const Body& body, affinity_partitioner& partitioner ) {
serial::interface9::start_for<Range,Body,affinity_partitioner>::run(range,body,partitioner);
}

Expand Down Expand Up @@ -161,53 +161,53 @@ void parallel_for_impl(Index first, Index last, Index step, const Function& f, P

//! Parallel iteration over a range of integers with explicit step and default partitioner
template <typename Index, typename Function>
__TBB_DEPRECATED_VERBOSE void parallel_for(Index first, Index last, Index step, const Function& f) {
__TBB_DEPRECATED_IN_VERBOSE_MODE void parallel_for(Index first, Index last, Index step, const Function& f) {
parallel_for_impl<Index,Function,const auto_partitioner>(first, last, step, f, auto_partitioner());
}
//! Parallel iteration over a range of integers with explicit step and simple partitioner
template <typename Index, typename Function>
__TBB_DEPRECATED_VERBOSE void parallel_for(Index first, Index last, Index step, const Function& f, const simple_partitioner& p) {
__TBB_DEPRECATED_IN_VERBOSE_MODE void parallel_for(Index first, Index last, Index step, const Function& f, const simple_partitioner& p) {
parallel_for_impl<Index,Function,const simple_partitioner>(first, last, step, f, p);
}
//! Parallel iteration over a range of integers with explicit step and auto partitioner
template <typename Index, typename Function>
__TBB_DEPRECATED_VERBOSE void parallel_for(Index first, Index last, Index step, const Function& f, const auto_partitioner& p) {
__TBB_DEPRECATED_IN_VERBOSE_MODE void parallel_for(Index first, Index last, Index step, const Function& f, const auto_partitioner& p) {
parallel_for_impl<Index,Function,const auto_partitioner>(first, last, step, f, p);
}
//! Parallel iteration over a range of integers with explicit step and static partitioner
template <typename Index, typename Function>
__TBB_DEPRECATED_VERBOSE void parallel_for(Index first, Index last, Index step, const Function& f, const static_partitioner& p) {
__TBB_DEPRECATED_IN_VERBOSE_MODE void parallel_for(Index first, Index last, Index step, const Function& f, const static_partitioner& p) {
parallel_for_impl<Index,Function,const static_partitioner>(first, last, step, f, p);
}
//! Parallel iteration over a range of integers with explicit step and affinity partitioner
template <typename Index, typename Function>
__TBB_DEPRECATED_VERBOSE void parallel_for(Index first, Index last, Index step, const Function& f, affinity_partitioner& p) {
__TBB_DEPRECATED_IN_VERBOSE_MODE void parallel_for(Index first, Index last, Index step, const Function& f, affinity_partitioner& p) {
parallel_for_impl(first, last, step, f, p);
}

//! Parallel iteration over a range of integers with default step and default partitioner
template <typename Index, typename Function>
__TBB_DEPRECATED_VERBOSE void parallel_for(Index first, Index last, const Function& f) {
__TBB_DEPRECATED_IN_VERBOSE_MODE void parallel_for(Index first, Index last, const Function& f) {
parallel_for_impl<Index,Function,const auto_partitioner>(first, last, static_cast<Index>(1), f, auto_partitioner());
}
//! Parallel iteration over a range of integers with default step and simple partitioner
template <typename Index, typename Function>
__TBB_DEPRECATED_VERBOSE void parallel_for(Index first, Index last, const Function& f, const simple_partitioner& p) {
__TBB_DEPRECATED_IN_VERBOSE_MODE void parallel_for(Index first, Index last, const Function& f, const simple_partitioner& p) {
parallel_for_impl<Index,Function,const simple_partitioner>(first, last, static_cast<Index>(1), f, p);
}
//! Parallel iteration over a range of integers with default step and auto partitioner
template <typename Index, typename Function>
__TBB_DEPRECATED_VERBOSE void parallel_for(Index first, Index last, const Function& f, const auto_partitioner& p) {
__TBB_DEPRECATED_IN_VERBOSE_MODE void parallel_for(Index first, Index last, const Function& f, const auto_partitioner& p) {
parallel_for_impl<Index,Function,const auto_partitioner>(first, last, static_cast<Index>(1), f, p);
}
//! Parallel iteration over a range of integers with default step and static partitioner
template <typename Index, typename Function>
__TBB_DEPRECATED_VERBOSE void parallel_for(Index first, Index last, const Function& f, const static_partitioner& p) {
__TBB_DEPRECATED_IN_VERBOSE_MODE void parallel_for(Index first, Index last, const Function& f, const static_partitioner& p) {
parallel_for_impl<Index,Function,const static_partitioner>(first, last, static_cast<Index>(1), f, p);
}
//! Parallel iteration over a range of integers with default step and affinity_partitioner
template <typename Index, typename Function>
__TBB_DEPRECATED_VERBOSE void parallel_for(Index first, Index last, const Function& f, affinity_partitioner& p) {
__TBB_DEPRECATED_IN_VERBOSE_MODE void parallel_for(Index first, Index last, const Function& f, affinity_partitioner& p) {
parallel_for_impl(first, last, static_cast<Index>(1), f, p);
}

Expand Down
2 changes: 1 addition & 1 deletion include/tbb/aligned_space.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace tbb {
/** The elements are not constructed or destroyed by this class.
@ingroup memory_allocation */
template<typename T,size_t N=1>
class __TBB_DEPRECATED_VERBOSE_MSG("tbb::aligned_space is deprecated, use std::aligned_storage") aligned_space {
class __TBB_DEPRECATED_IN_VERBOSE_MODE_MSG("tbb::aligned_space is deprecated, use std::aligned_storage") aligned_space {
private:
typedef __TBB_TypeWithAlignmentAtLeastAsStrict(T) element_type;
element_type array[(sizeof(T)*N+sizeof(element_type)-1)/sizeof(element_type)];
Expand Down
14 changes: 7 additions & 7 deletions include/tbb/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ struct atomic_impl_with_arithmetic: atomic_impl<I> {
/** See the Reference for details.
@ingroup synchronization */
template<typename T>
struct __TBB_DEPRECATED_VERBOSE_MSG("tbb::atomic is deprecated, use std::atomic")
struct __TBB_DEPRECATED_IN_VERBOSE_MODE_MSG("tbb::atomic is deprecated, use std::atomic")
atomic: internal::atomic_impl<T> {
#if __TBB_ATOMIC_CTORS
atomic() = default;
Expand All @@ -430,7 +430,7 @@ atomic: internal::atomic_impl<T> {

#if __TBB_ATOMIC_CTORS
#define __TBB_DECL_ATOMIC(T) \
template<> struct __TBB_DEPRECATED_VERBOSE_MSG("tbb::atomic is deprecated, use std::atomic") \
template<> struct __TBB_DEPRECATED_IN_VERBOSE_MODE_MSG("tbb::atomic is deprecated, use std::atomic") \
atomic<T>: internal::atomic_impl_with_arithmetic<T,T,char> { \
atomic() = default; \
constexpr atomic(T arg): internal::atomic_impl_with_arithmetic<T,T,char>(arg) {} \
Expand All @@ -442,7 +442,7 @@ atomic: internal::atomic_impl<T> {
};
#else
#define __TBB_DECL_ATOMIC(T) \
template<> struct __TBB_DEPRECATED_VERBOSE_MSG("tbb::atomic is deprecated, use std::atomic") \
template<> struct __TBB_DEPRECATED_IN_VERBOSE_MODE_MSG("tbb::atomic is deprecated, use std::atomic") \
atomic<T>: internal::atomic_impl_with_arithmetic<T,T,char> { \
T operator=( T rhs ) {return store_with_release(rhs);} \
atomic<T>& operator=( const atomic<T>& rhs ) {store_with_release(rhs); return *this;} \
Expand All @@ -467,7 +467,7 @@ __TBB_DECL_ATOMIC(unsigned long)
type synonyms on the platform. Type U should be the wider variant of T from the
perspective of /Wp64. */
#define __TBB_DECL_ATOMIC_ALT(T,U) \
template<> struct __TBB_DEPRECATED_VERBOSE_MSG("tbb::atomic is deprecated, use std::atomic") \
template<> struct __TBB_DEPRECATED_IN_VERBOSE_MODE_MSG("tbb::atomic is deprecated, use std::atomic") \
atomic<T>: internal::atomic_impl_with_arithmetic<T,T,char> { \
atomic() = default ; \
constexpr atomic(T arg): internal::atomic_impl_with_arithmetic<T,T,char>(arg) {} \
Expand All @@ -479,7 +479,7 @@ __TBB_DECL_ATOMIC(unsigned long)
};
#else
#define __TBB_DECL_ATOMIC_ALT(T,U) \
template<> struct __TBB_DEPRECATED_VERBOSE_MSG("tbb::atomic is deprecated, use std::atomic") \
template<> struct __TBB_DEPRECATED_IN_VERBOSE_MODE_MSG("tbb::atomic is deprecated, use std::atomic") \
atomic<T>: internal::atomic_impl_with_arithmetic<T,T,char> { \
T operator=( U rhs ) {return store_with_release(T(rhs));} \
atomic<T>& operator=( const atomic<T>& rhs ) {store_with_release(rhs); return *this;} \
Expand All @@ -503,7 +503,7 @@ __TBB_DECL_ATOMIC(wchar_t)
#endif /* _MSC_VER||!defined(_NATIVE_WCHAR_T_DEFINED) */

//! Specialization for atomic<T*> with arithmetic and operator->.
template<typename T> struct __TBB_DEPRECATED_VERBOSE_MSG("tbb::atomic is deprecated, use std::atomic")
template<typename T> struct __TBB_DEPRECATED_IN_VERBOSE_MODE_MSG("tbb::atomic is deprecated, use std::atomic")
atomic<T*>: internal::atomic_impl_with_arithmetic<T*,ptrdiff_t,T> {
#if __TBB_ATOMIC_CTORS
atomic() = default ;
Expand All @@ -523,7 +523,7 @@ atomic<T*>: internal::atomic_impl_with_arithmetic<T*,ptrdiff_t,T> {
};

//! Specialization for atomic<void*>, for sake of not allowing arithmetic or operator->.
template<> struct __TBB_DEPRECATED_VERBOSE_MSG("tbb::atomic is deprecated, use std::atomic")
template<> struct __TBB_DEPRECATED_IN_VERBOSE_MODE_MSG("tbb::atomic is deprecated, use std::atomic")
atomic<void*>: internal::atomic_impl<void*> {
#if __TBB_ATOMIC_CTORS
atomic() = default ;
Expand Down
20 changes: 10 additions & 10 deletions include/tbb/compat/condition_variable
Original file line number Diff line number Diff line change
Expand Up @@ -79,17 +79,17 @@ namespace interface5 {

// C++0x standard working draft 30.4.3
// Lock tag types
struct __TBB_DEPRECATED_VERBOSE defer_lock_t { }; //! do not acquire ownership of the mutex
struct __TBB_DEPRECATED_VERBOSE try_to_lock_t { }; //! try to acquire ownership of the mutex without blocking
struct __TBB_DEPRECATED_VERBOSE adopt_lock_t { }; //! assume the calling thread has already
__TBB_DEPRECATED_VERBOSE const defer_lock_t defer_lock = {};
__TBB_DEPRECATED_VERBOSE const try_to_lock_t try_to_lock = {};
__TBB_DEPRECATED_VERBOSE const adopt_lock_t adopt_lock = {};
struct __TBB_DEPRECATED_IN_VERBOSE_MODE defer_lock_t { }; //! do not acquire ownership of the mutex
struct __TBB_DEPRECATED_IN_VERBOSE_MODE try_to_lock_t { }; //! try to acquire ownership of the mutex without blocking
struct __TBB_DEPRECATED_IN_VERBOSE_MODE adopt_lock_t { }; //! assume the calling thread has already
__TBB_DEPRECATED_IN_VERBOSE_MODE const defer_lock_t defer_lock = {};
__TBB_DEPRECATED_IN_VERBOSE_MODE const try_to_lock_t try_to_lock = {};
__TBB_DEPRECATED_IN_VERBOSE_MODE const adopt_lock_t adopt_lock = {};

// C++0x standard working draft 30.4.3.1
//! lock_guard
template<typename M>
class __TBB_DEPRECATED_VERBOSE lock_guard : tbb::internal::no_copy {
class __TBB_DEPRECATED_IN_VERBOSE_MODE lock_guard : tbb::internal::no_copy {
public:
//! mutex type
typedef M mutex_type;
Expand All @@ -112,7 +112,7 @@ private:
// C++0x standard working draft 30.4.3.2
//! unique_lock
template<typename M>
class __TBB_DEPRECATED_VERBOSE unique_lock : tbb::internal::no_copy {
class __TBB_DEPRECATED_IN_VERBOSE_MODE unique_lock : tbb::internal::no_copy {
friend class condition_variable;
public:
typedef M mutex_type;
Expand Down Expand Up @@ -245,7 +245,7 @@ private:
};

template<typename M>
__TBB_DEPRECATED_VERBOSE bool unique_lock<M>::try_lock_for( const tick_count::interval_t &i)
__TBB_DEPRECATED_IN_VERBOSE_MODE bool unique_lock<M>::try_lock_for( const tick_count::interval_t &i)
{
const int unique_lock_tick = 100; /* microseconds; 0.1 milliseconds */
// the smallest wait-time is 0.1 milliseconds.
Expand Down Expand Up @@ -292,7 +292,7 @@ enum cv_status { no_timeout, timeout };
//! condition variable
/** C++0x standard working draft 30.5.1
@ingroup synchronization */
class __TBB_DEPRECATED_VERBOSE condition_variable : tbb::internal::no_copy {
class __TBB_DEPRECATED_IN_VERBOSE_MODE condition_variable : tbb::internal::no_copy {
public:
//! Constructor
condition_variable() {
Expand Down
Loading

0 comments on commit 60b7d0a

Please sign in to comment.