Skip to content

Commit

Permalink
Committing oneTBB 2021.1-beta10 source code
Browse files Browse the repository at this point in the history
  • Loading branch information
tbbdev committed Oct 27, 2020
1 parent 8632c27 commit 978af3d
Show file tree
Hide file tree
Showing 138 changed files with 2,820 additions and 1,089 deletions.
18 changes: 9 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ string(REGEX REPLACE ".*#define TBB_VERSION_MAJOR ([0-9]+).*" "\\1" _tbb_ver_maj
string(REGEX REPLACE ".*#define TBB_VERSION_MINOR ([0-9]+).*" "\\1" _tbb_ver_minor "${_tbb_version_info}")
string(REGEX REPLACE ".*#define TBB_INTERFACE_VERSION ([0-9]+).*" "\\1" TBB_INTERFACE_VERSION "${_tbb_version_info}")
string(REGEX REPLACE ".*#define __TBB_BINARY_VERSION ([0-9]+).*" "\\1" TBB_BINARY_VERSION "${_tbb_version_info}")
set(TBB_BINARY_MINOR_VERSION 0)
set(TBB_BINARY_MINOR_VERSION 1)
set(TBBMALLOC_BINARY_VERSION 2)
set(TBBBIND_BINARY_VERSION 3)

Expand Down Expand Up @@ -203,18 +203,18 @@ else()
install(DIRECTORY include
DESTINATION .)

install(EXPORT ${CMAKE_PROJECT_NAME}Targets
install(EXPORT ${PROJECT_NAME}Targets
NAMESPACE TBB::
DESTINATION lib/cmake/${CMAKE_PROJECT_NAME})
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}Config.cmake
"include(\${CMAKE_CURRENT_LIST_DIR}/${CMAKE_PROJECT_NAME}Targets.cmake)\n")
DESTINATION lib/cmake/${PROJECT_NAME})
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
"include(\${CMAKE_CURRENT_LIST_DIR}/${PROJECT_NAME}Targets.cmake)\n")

write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}ConfigVersion.cmake"
write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
COMPATIBILITY AnyNewerVersion)

install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}Config.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}ConfigVersion.cmake"
DESTINATION lib/cmake/${CMAKE_PROJECT_NAME})
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
DESTINATION lib/cmake/${PROJECT_NAME})
# -------------------------------------------------------------------
endif()

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# oneAPI Threading Building Blocks (Beta)
[![Apache License Version 2.0](https://img.shields.io/badge/license-Apache_2.0-green.svg)](LICENSE)
[![Apache License Version 2.0](https://img.shields.io/badge/license-Apache_2.0-green.svg)](LICENSE.txt)

oneAPI Threading Building Blocks (oneTBB) lets you easily write parallel C++ programs that take
full advantage of multicore performance, that are portable, composable and have future-proof scalability.
Expand All @@ -19,7 +19,7 @@ Please report issues and suggestions via

## How to Contribute
To contribute to oneTBB, please open a GitHub pull request (preferred) or send us a patch by e-mail.
oneAPI Threading Building Blocks is licensed under [Apache License, Version 2.0](LICENSE).
oneAPI Threading Building Blocks is licensed under [Apache License, Version 2.0](LICENSE.txt).
By its terms, contributions submitted to the project are also done under that license.

## Engineering team contacts
Expand Down
2 changes: 1 addition & 1 deletion cmake/compilers/GNU.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ endif()

# TBB malloc settings
set(TBBMALLOC_LIB_COMPILE_FLAGS -fno-rtti -fno-exceptions)

set(TBB_OPENMP_FLAG -fopenmp)
3 changes: 3 additions & 0 deletions cmake/compilers/Intel.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@
if (MSVC)
include(${CMAKE_CURRENT_LIST_DIR}/MSVC.cmake)
set(TBB_WARNING_LEVEL ${TBB_WARNING_LEVEL} /W3)
set(TBB_OPENMP_FLAG /Qopenmp)
elseif (APPLE)
include(${CMAKE_CURRENT_LIST_DIR}/AppleClang.cmake)
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -fstack-protector -Wformat -Wformat-security
$<$<NOT:$<CONFIG:Debug>>:-fno-omit-frame-pointer -qno-opt-report-embed -D_FORTIFY_SOURCE=2>)
set(TBB_OPENMP_FLAG -qopenmp)
else()
include(${CMAKE_CURRENT_LIST_DIR}/GNU.cmake)
set(TBB_LIB_LINK_FLAGS ${TBB_LIB_LINK_FLAGS} -static-intel -Wl,-z,relro,-z,now,)
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -fstack-protector -Wformat -Wformat-security
$<$<NOT:$<CONFIG:Debug>>:-qno-opt-report-embed -D_FORTIFY_SOURCE=2>
$<$<EQUAL:${TBB_ARCH},32>:-falign-stack=maintain-16-byte>)
set(TBB_OPENMP_FLAG -qopenmp)
endif()
2 changes: 2 additions & 0 deletions cmake/compilers/MSVC.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,5 @@ if (TBB_WINDOWS_DRIVER)

set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} /D _UNICODE /DUNICODE /DWINAPI_FAMILY=WINAPI_FAMILY_APP /D__WRL_NO_DEFAULT_LIB__)
endif()

set(TBB_OPENMP_FLAG /openmp)
2 changes: 1 addition & 1 deletion cmake/packaging.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

# Note: current implementation uses CMAKE_BUILD_TYPE,
# this parameter is not defined for multi-config generators.
set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
set(CPACK_PACKAGE_NAME "${PROJECT_NAME}")
set(CPACK_PACKAGE_VERSION "${TBB_VERSION}")
string(TOLOWER ${CPACK_PACKAGE_NAME}-${PROJECT_VERSION}-${CMAKE_SYSTEM_NAME}_${TBB_OUTPUT_DIR_BASE}_${CMAKE_BUILD_TYPE} CPACK_PACKAGE_FILE_NAME)
set(CPACK_GENERATOR ZIP)
Expand Down
6 changes: 3 additions & 3 deletions cmake/vars_utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ else()
set(TBB_VARS_TEMPLATE "linux/env/vars.sh.in")
endif()

get_filename_component(TBB_VARS_TEMPLATE_NAME ${CMAKE_SOURCE_DIR}/integration/${TBB_VARS_TEMPLATE} NAME)
get_filename_component(TBB_VARS_TEMPLATE_NAME ${PROJECT_SOURCE_DIR}/integration/${TBB_VARS_TEMPLATE} NAME)
string(REPLACE ".in" "" TBB_VARS_NAME ${TBB_VARS_TEMPLATE_NAME})

macro(tbb_gen_vars target)
add_custom_command(TARGET ${target} POST_BUILD COMMAND
${CMAKE_COMMAND}
-DBINARY_DIR=${CMAKE_BINARY_DIR}
-DSOURCE_DIR=${CMAKE_SOURCE_DIR}
-DSOURCE_DIR=${PROJECT_SOURCE_DIR}
-DBIN_PATH=$<TARGET_FILE_DIR:${target}>
-DVARS_TEMPLATE=${TBB_VARS_TEMPLATE}
-DVARS_NAME=${TBB_VARS_NAME}
-DTBB_INSTALL_VARS=${TBB_INSTALL_VARS}
-P ${CMAKE_SOURCE_DIR}/integration/cmake/generate_vars.cmake
-P ${PROJECT_SOURCE_DIR}/integration/cmake/generate_vars.cmake
)
endmacro(tbb_gen_vars)

Expand Down
1 change: 1 addition & 0 deletions doc/DoxygenLayout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<tab type="filelist" visible="no" title="" intro=""/>
<tab type="globals" visible="no" title="" intro=""/>
</tab>
<tab type="user" url="@ref test_classification" visible="yes" title="Test Classification"/>
<tab type="examples" visible="yes" title="" intro=""/>
</navindex>

Expand Down
2 changes: 2 additions & 0 deletions include/tbb/concurrent_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ class concurrent_map : public concurrent_skip_list<map_traits<Key, Value, Compar

// Include constructors of base type
using base_type::base_type;
using base_type::operator=;

// Observers
mapped_type& at(const key_type& key) {
Expand Down Expand Up @@ -215,6 +216,7 @@ class concurrent_multimap : public concurrent_skip_list<map_traits<Key, Value, C
// Include constructors of base_type
using base_type::base_type;
using base_type::insert;
using base_type::operator=;

template <typename P>
typename std::enable_if<std::is_constructible<value_type, P&&>::value,
Expand Down
4 changes: 1 addition & 3 deletions include/tbb/concurrent_priority_queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,6 @@ class concurrent_priority_queue {
};
cpq_operation( const value_type& value, operation_type t )
: type(t), elem(const_cast<value_type*>(&value)) {}

cpq_operation( operation_type t ) : type(t) {}
}; // class cpq_operation

class functor {
Expand Down Expand Up @@ -477,7 +475,7 @@ void swap( concurrent_priority_queue<T, Compare, Allocator>& lhs,
inline namespace v1 {
using detail::d1::concurrent_priority_queue;

}; // inline namespace v1
} // inline namespace v1
} // namespace tbb

#endif // __TBB_concurrent_priority_queue_H
2 changes: 2 additions & 0 deletions include/tbb/concurrent_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class concurrent_set : public concurrent_skip_list<set_traits<Key, Compare, conc

// Include constructors of base_type
using base_type::base_type;
using base_type::operator=;

template<typename OtherCompare>
void merge(concurrent_set<key_type, OtherCompare, Allocator>& source) {
Expand Down Expand Up @@ -148,6 +149,7 @@ class concurrent_multiset : public concurrent_skip_list<set_traits<Key, Compare,

// Include constructors of base_type;
using base_type::base_type;
using base_type::operator=;

template<typename OtherCompare>
void merge(concurrent_set<key_type, OtherCompare, Allocator>& source) {
Expand Down
3 changes: 2 additions & 1 deletion include/tbb/concurrent_unordered_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class concurrent_unordered_map

// Include constructors of base type
using base_type::base_type;
using base_type::operator=;

// Observers
mapped_type& operator[]( const key_type& key ) {
Expand Down Expand Up @@ -220,7 +221,7 @@ class concurrent_unordered_multimap

// Include constructors of base type
using base_type::base_type;

using base_type::operator=;
using base_type::insert;

template <typename P>
Expand Down
2 changes: 2 additions & 0 deletions include/tbb/concurrent_unordered_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ class concurrent_unordered_set

// Include constructors of base_type;
using base_type::base_type;
using base_type::operator=;

template <typename OtherHash, typename OtherKeyEqual>
void merge( concurrent_unordered_set<key_type, OtherHash, OtherKeyEqual, allocator_type>& source ) {
Expand Down Expand Up @@ -162,6 +163,7 @@ class concurrent_unordered_multiset

// Include constructors of base_type;
using base_type::base_type;
using base_type::operator=;

template <typename OtherHash, typename OtherKeyEqual>
void merge( concurrent_unordered_set<key_type, OtherHash, OtherKeyEqual, allocator_type>& source ) {
Expand Down
7 changes: 3 additions & 4 deletions include/tbb/detail/_aggregator.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ class aggregator : public aggregator_generic<OperationType> {
HandlerType handle_operations;
public:
aggregator() = default;
explicit aggregator( HandlerType h ) : handle_operations(h) {}

void initialize_handler( HandlerType h ) { handle_operations = h; }

Expand All @@ -167,8 +166,8 @@ class aggregating_functor {
}; // class aggregating_functor


}; // namespace d1
}; // namespace detail
}; // namespace tbb
} // namespace d1
} // namespace detail
} // namespace tbb

#endif // __TBB_detail__aggregator_H
2 changes: 2 additions & 0 deletions include/tbb/detail/_concurrent_unordered_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,8 @@ class concurrent_unordered_base {
return my_midpoint_node != my_end_node;
}

size_type grainsize() const { return 1; }

const_range_type( const_range_type& range, split )
: my_instance(range.my_instance),
my_begin_node(range.my_midpoint_node),
Expand Down
4 changes: 3 additions & 1 deletion include/tbb/detail/_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,8 @@

#define __TBB_TSX_INTRINSICS_PRESENT ((__RTM__ || _MSC_VER>=1700 || __INTEL_COMPILER) && !__ANDROID__)

#define __TBB_WAITPKG_INTRINSICS_PRESENT ((__INTEL_COMPILER >= 1900 || __TBB_GCC_VERSION >= 110000 || __TBB_CLANG_VERSION >= 120000) && !__ANDROID__)

/** Internal TBB features & modes **/

/** __TBB_SOURCE_DIRECTLY_INCLUDED is a mode used in whitebox testing when
Expand Down Expand Up @@ -334,7 +336,7 @@
#define __TBB_ARENA_OBSERVER __TBB_SCHEDULER_OBSERVER
#endif /* __TBB_ARENA_OBSERVER */

#if TBB_PREVIEW_NUMA_SUPPORT || __TBB_BUILD
#ifndef __TBB_NUMA_SUPPORT
#define __TBB_NUMA_SUPPORT 1
#endif

Expand Down
31 changes: 9 additions & 22 deletions include/tbb/detail/_flow_graph_body_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ class type_to_key_function_body_leaf : public type_to_key_function_body<Input, O
public:
type_to_key_function_body_leaf( const B &_body ) : body(_body) { }
Output operator()(const Input &i) override { return body(i); }
B get_body() { return body; }
type_to_key_function_body_leaf* clone() override {
return new type_to_key_function_body_leaf< Input, Output, B>(body);
}
Expand All @@ -233,7 +232,6 @@ class type_to_key_function_body_leaf<Input,Output&,B> : public type_to_key_funct
const Output& operator()(const Input &i) override {
return body(i);
}
B get_body() { return body; }
type_to_key_function_body_leaf* clone() override {
return new type_to_key_function_body_leaf< Input, Output&, B>(body);
}
Expand Down Expand Up @@ -313,12 +311,6 @@ class input_node_task_bypass : public graph_task {

// ------------------------ end of node task bodies -----------------------------------

//! An empty functor that takes an Input and returns a default constructed Output
template< typename Input, typename Output >
struct empty_body {
Output operator()( const Input & ) const { return Output(); }
};

template<typename T, typename DecrementType, typename DummyType = void>
class decrementer;

Expand All @@ -342,15 +334,12 @@ class decrementer<T, DecrementType,
}

template<typename U, typename V> friend class limiter_node;
void reset_receiver( reset_flags ) override {
}
void reset_receiver( reset_flags ) {}

public:
// Since decrementer does not make use of possibly unconstructed owner inside its
// constructor, my_node can be directly initialized with 'this' pointer passed from the
// owner, hence making method 'set_owner' needless.
decrementer() : my_node(NULL) {}
void set_owner( T *node ) { my_node = node; }
decrementer(T* owner) : my_node(owner) {
// Do not work with the passed pointer here as it may not be fully initialized yet
}
};

template<typename T>
Expand All @@ -372,13 +361,11 @@ class decrementer<T, continue_msg, void> : public continue_receiver, no_copy {

typedef continue_msg input_type;
typedef continue_msg output_type;
decrementer() : continue_receiver( /*number_of_predecessors=*/0, no_priority )
// Since decrementer does not make use of possibly unconstructed owner inside its
// constructor, my_node can be directly initialized with 'this' pointer passed from the
// owner, hence making method 'set_owner' needless.
, my_node(NULL)
{}
void set_owner( T *node ) { my_node = node; }
decrementer(T* owner)
: continue_receiver( /*number_of_predecessors=*/0, no_priority ), my_node(owner)
{
// Do not work with the passed pointer here as it may not be fully initialized yet
}
};

#endif // __TBB__flow_graph_body_impl_H
Loading

0 comments on commit 978af3d

Please sign in to comment.