43 lines
1.6 KiB
Markdown
43 lines
1.6 KiB
Markdown
[execpol.general]
|
||
|
||
# 26 Algorithms library [[algorithms]](./#algorithms)
|
||
|
||
## 26.3 Parallel algorithms [[algorithms.parallel]](algorithms.parallel#execpol.general)
|
||
|
||
### 26.3.6 Execution policies [[execpol]](execpol#general)
|
||
|
||
#### 26.3.6.1 General [execpol.general]
|
||
|
||
[1](#1)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/algorithms.tex#L636)
|
||
|
||
Subclause [[execpol]](execpol "26.3.6 Execution policies") describes classes that are [*execution policy*](#def:execution_policy "26.3.6.1 General [execpol.general]") types[.](#1.sentence-1)
|
||
|
||
An
|
||
object of an execution policy type indicates the kinds of parallelism allowed
|
||
in the execution of an algorithm and expresses the consequent requirements on
|
||
the element access functions[.](#1.sentence-2)
|
||
|
||
Execution policy types are declared in header [<execution>](execution.syn#header:%3cexecution%3e "33.4 Header <execution> synopsis [execution.syn]")[.](#1.sentence-3)
|
||
|
||
[*Example [1](#example-1)*: using namespace std;
|
||
vector<int> v = /* ... */;
|
||
|
||
// standard sequential sort sort(v.begin(), v.end());
|
||
|
||
// explicitly sequential sort sort(execution::seq, v.begin(), v.end());
|
||
|
||
// permitting parallel execution sort(execution::par, v.begin(), v.end());
|
||
|
||
// permitting vectorization as well sort(execution::par_unseq, v.begin(), v.end()); â *end example*]
|
||
|
||
[*Note [1](#note-1)*:
|
||
|
||
Implementations can provide additional execution policies
|
||
to those described in this document as extensions
|
||
to address parallel architectures that require idiosyncratic
|
||
parameters for efficient execution[.](#1.sentence-4)
|
||
|
||
â *end note*]
|