Intel® oneAPI Threading Building Blocks Developer Guide and API Reference
ID
772616
Date
4/11/2022
Public
A newer version of this document is available. Customers should click here to go to the newest version.
Package Contents
Parallelizing Simple Loops
Parallelizing Complex Loops
Parallelizing Data Flow and Dependence Graphs
Work Isolation
Exceptions and Cancellation
Containers
Mutual Exclusion
Timing
Memory Allocation
The Task Scheduler
Design Patterns
Migrating from Threading Building Blocks (TBB)
Constrained APIs
Appendix A Costs of Time Slicing
Appendix B Mixing With Other Threading Packages
References
oneapi::tbb::info namespace
parallel_for_each Body semantics and requirements
parallel_sort ranges interface extension
Description
API
Type-specified message keys for join_node
Scalable Memory Pools
Helper Functions for Expressing Graphs
concurrent_lru_cache
task_arena::constraints extensions
oneapi::tbb::info namespace extensions
task_group extensions
The customizing mutex type for concurrent_hash_map
parallel_sort ranges interface extension
Description
Intel® oneAPI Threading Building Blocks (oneTBB) implementation extends the oneapi::tbb::parallel_sort specification with overloads that takes the container by forwarding reference.
API
Header
#include <oneapi/tbb/parallel_sort.h>
Syntax
namespace oneapi { namespace tbb { template <typename Container> void parallel_sort( Container&& c ); template <typename Container, typename Compare> void parallel_sort( Container&& c, const Compare& comp ); } // namespace tbb } // namespace oneapi
Functions
template<typenameContainer>voidparallel_sort(Container&&c);
Equivalent to parallel_sort( std::begin(c), std::end(c), comp ), where comp uses operator< to determine relative orderings.
template<typenameContainer,typenameCompare>voidparallel_sort(Container&&c, constCompare&comp);
Equivalent to parallel_sort( std::begin(c), std::end(c), comp ).
Example
This interface may be used for sorting rvalue or constant views:
#include <array> #include <span> // requires C++20 #include <oneapi/tbb/parallel_sort.h> std::span<int> get_span() { static std::array<int, 3> arr = {3, 2, 1}; return std::span<int>(arr); } int main() { tbb::parallel_sort(get_span()); }