Name
Partitioner Concept — Requirements for a type that decides whether a range should be operated on by a task body or further split. Table 3-4 lists the requirements for a partitioner type P.
Synopsis
Table 3-4. Partitioner Concept
|
Pseudosignature |
Semantics |
|---|---|
|
|
Destructor. |
|
|
|
|
|
Split pinto two partitioners. |
Description
The partitioner implements rules for deciding when a given range should no longer be subdivided, but should be operated over as a whole by a task’s body.
The default behavior of the algorithms parallel_for, parallel_reduce, and parallel_scan is to recursively split a range until no subrange remains that is divisible, as decided by the function is_divisible of the Range Concept. The Partitioner Concept models rules for the early termination of the recursive splitting of a range, providing the ability to change the default behavior. A Partitioner object’s decision making is implemented using two functions: a splitting constructor and the function should_execute_range.
Within the parallel algorithms, each Range object is associated with a Partitioner object. Whenever a Range object is split using its splitting constructor to create two subranges, the associated Partitioner object is likewise split to create two matching Partitioner objects.
When a parallel_for, parallel_reduce ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access