tmp/tmp_c7ddr55/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### In general <a id="execpol.general">[[execpol.general]]</a>
|
| 2 |
+
|
| 3 |
+
This subclause describes classes that are *execution policy* types. An
|
| 4 |
+
object of an execution policy type indicates the kinds of parallelism
|
| 5 |
+
allowed in the execution of an algorithm and expresses the consequent
|
| 6 |
+
requirements on the element access functions.
|
| 7 |
+
|
| 8 |
+
[*Example 1*:
|
| 9 |
+
|
| 10 |
+
``` cpp
|
| 11 |
+
using namespace std;
|
| 12 |
+
vector<int> v = ...;
|
| 13 |
+
|
| 14 |
+
// standard sequential sort
|
| 15 |
+
sort(v.begin(), v.end());
|
| 16 |
+
|
| 17 |
+
// explicitly sequential sort
|
| 18 |
+
sort(execution::seq, v.begin(), v.end());
|
| 19 |
+
|
| 20 |
+
// permitting parallel execution
|
| 21 |
+
sort(execution::par, v.begin(), v.end());
|
| 22 |
+
|
| 23 |
+
// permitting vectorization as well
|
| 24 |
+
sort(execution::par_unseq, v.begin(), v.end());
|
| 25 |
+
```
|
| 26 |
+
|
| 27 |
+
— *end example*]
|
| 28 |
+
|
| 29 |
+
[*Note 1*: Because different parallel architectures may require
|
| 30 |
+
idiosyncratic parameters for efficient execution, implementations may
|
| 31 |
+
provide additional execution policies to those described in this
|
| 32 |
+
standard as extensions. — *end note*]
|
| 33 |
+
|