Difference between revisions of "cpp/experimental/parallelism"
(→Parallelized versions of existing algorithms: collapse) |
m (templates) |
||
Line 106: | Line 106: | ||
{{dsc tfun | cpp/experimental/for_each_n | applies a function object to the first n elements of a sequence }} | {{dsc tfun | cpp/experimental/for_each_n | applies a function object to the first n elements of a sequence }} | ||
{{dsc header | experimental/numeric }} | {{dsc header | experimental/numeric }} | ||
− | {{dsc | + | {{dsc inc | cpp/experimental/parallelism/dsc reduce}} |
{{dsc tfun | cpp/experimental/exclusive_scan | similar to {{lc|std::partial_sum}}, excludes the ith input element from the ith sum}} | {{dsc tfun | cpp/experimental/exclusive_scan | similar to {{lc|std::partial_sum}}, excludes the ith input element from the ith sum}} | ||
{{dsc tfun | cpp/experimental/inclusive_scan | similar to {{lc|std::partial_sum}}, includes the ith input element in the ith sum}} | {{dsc tfun | cpp/experimental/inclusive_scan | similar to {{lc|std::partial_sum}}, includes the ith input element in the ith sum}} | ||
− | {{dsc | + | {{dsc inc | cpp/experimental/parallelism/dsc transform_reduce}} |
{{dsc tfun | cpp/experimental/transform_exclusive_scan | applies a functor, then calculates exclusive scan }} | {{dsc tfun | cpp/experimental/transform_exclusive_scan | applies a functor, then calculates exclusive scan }} | ||
{{dsc tfun | cpp/experimental/transform_inclusive_scan | applies a functor, then calculates inclusive scan}} | {{dsc tfun | cpp/experimental/transform_inclusive_scan | applies a functor, then calculates inclusive scan}} | ||
{{dsc end}} | {{dsc end}} |
Revision as of 13:26, 30 August 2015
The C++ Extensions for Parallelism, ISO/IEC TS 19570:2015 defines the following new components for the C++ standard library:
Contents |
Execution policies
The parallelism TS describes three execution policies: sequential, parallel, and parallel+vector, and provides corresponding execution policy types and objects. Users may select an execution policy statically by invoking a parallel algorithm with the an execution policy object of the corresponding type, or dynamically by using the type-erasing execution_policy
class.
Implementations may define additional execution policies as an extension. The semantics of parallel algorithms invoked with an execution policy object of implementation-defined type is implementation-defined.
Defined in header
<experimental/execution_policy> | |
execution policy types (class) | |
global execution policy objects (constant) | |
dynamic execution policy (class) | |
test whether a class represents an execution policy (class template) |
Exception lists
Defined in header
<experimental/exception_list> | |
exceptions raised during parallel executions (class) |
Parallelized versions of existing algorithms
The TS provides parallelized versions of the following 69 algorithms from <algorithm>, <numeric> and <memory>:
New algorithms
Defined in header
<experimental/algorithm> | |
similar to std::for_each except returns void (function template) | |
applies a function object to the first n elements of a sequence (function template) | |
Defined in header
<experimental/numeric> | |
(parallelism TS) |
similar to std::accumulate, except out of order (function template) |
similar to std::partial_sum, excludes the ith input element from the ith sum (function template) | |
similar to std::partial_sum, includes the ith input element in the ith sum (function template) | |
(parallelism TS) |
applies a functor, then reduces out of order (function template) |
applies a functor, then calculates exclusive scan (function template) | |
applies a functor, then calculates inclusive scan (function template) |