Skip to content

Commit b0ef447

Browse files
committed
Apply N4063 changes in teal
1 parent dec594c commit b0ef447

File tree

4 files changed

+87
-25
lines changed

4 files changed

+87
-25
lines changed

algorithms.html

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,35 @@ <h1>In general</h1>
77
This clause describes components that C++ programs may use to perform operations on containers
88
and other sequences in parallel.
99

10+
<cxx-section id="parallel.alg.general.user">
11+
<h1>Requirements on user-provided function objects</h1>
12+
13+
<p>
14+
<ins3>Function objects passed into parallel algorithms as objects of type <code>BinaryPredicate</code>,
15+
<code>Compare</code>, and <code>BinaryOperation</code> shall not directly or indirectly modify
16+
objects via their arguments.</ins3>
17+
</p>
18+
</cxx-section>
19+
1020
<cxx-section id="parallel.alg.general.exec">
1121
<h1>Effect of execution policies on algorithm execution</h1>
1222

1323
<p>
1424
Parallel algorithms have template parameters named <code>ExecutionPolicy</code> which describe
1525
the manner in which the execution of these algorithms may be parallelized and the manner in
16-
which they apply user-provided function objects.
26+
which they apply <del3>user-provided function objects</del3><ins3>the element access functions</ins3>.
1727
</p>
1828

1929
<p>
20-
The applications of function objects in parallel algorithms invoked with an execution policy
21-
object of type <code>sequential_execution_policy</code> execute in sequential order in the
22-
calling thread.
30+
The <del3>applications of function objects</del3><ins3>invocations of element access functions</ins3>
31+
in parallel algorithms invoked with an execution policy object of type <code>sequential_execution_policy</code>
32+
execute in sequential order in the calling thread.
2333
</p>
2434

2535
<p>
26-
The applications of function objects in parallel algorithms invoked with an execution policy
27-
object of type <code>parallel_execution_policy</code> are permitted to execute in an unordered
36+
The <del3>applications of function objects</del3><ins3>invocations of element access
37+
functions</ins3> in parallel algorithms invoked with an execution policy object of
38+
type <code>parallel_execution_policy</code> are permitted to execute in an unordered
2839
fashion in unspecified threads, and indeterminately sequenced within each thread.
2940

3041
<cxx-note>
@@ -77,9 +88,11 @@ <h1>Effect of execution policies on algorithm execution</h1>
7788
</cxx-example>
7889

7990
<p>
80-
The applications of function objects in parallel algorithms invoked with an execution policy
81-
of type <code><del2>vector_execution_policy</del2><ins2>parallel_vector_execution_policy</ins2></code> are permitted to execute in an unordered fashion
82-
in unspecified threads, and unsequenced within each thread.
91+
The <del3>applications of function objects</del3><ins3>invocations of element access functions</ins3>
92+
in parallel algorithms invoked with an execution policy of type
93+
<code><del2>vector_execution_policy</del2><ins2>parallel_vector_execution_policy</ins2></code>
94+
are permitted to execute in an unordered fashion in unspecified threads, and unsequenced
95+
within each thread.
8396
<ins2>
8497
<cxx-note>
8598
This means that multiple function object invocations may be interleaved on a single thread.

exceptions.html

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ <h1>Exception reporting behavior</h1>
88
the algorithm throws a <code>std::bad_alloc</code> exception.
99
</p>
1010
<p>
11-
During the execution of a standard parallel algorithm, if the application of a function
12-
object terminates with an uncaught exception, the behavior of the program is determined
13-
by the type of execution policy used to invoke the algorithm:
11+
During the execution of a standard parallel algorithm, if the <del3>application of a function
12+
object</del3><ins3>invocation of an element access function</ins> terminates with an uncaught
13+
exception, the behavior of the program is determined by the type of execution policy used to
14+
invoke the algorithm:
1415

1516
<ul>
1617
<li>
@@ -21,8 +22,8 @@ <h1>Exception reporting behavior</h1>
2122
If the execution policy object is of type <code>sequential_execution_policy</code> or
2223
<code>parallel_execution_policy</code>, the execution of the algorithm terminates with an
2324
<code>exception_list</code> exception. All uncaught exceptions thrown during
24-
the application of user-provided function objects shall be contained in the
25-
<code>exception_list</code>.<pre>
25+
the <del3>application of user-provided function objects</del3><ins3>invocations of element
26+
access functions</ins3> shall be contained in the <code>exception_list</code>.<pre>
2627
</pre>
2728

2829
<cxx-note>

execution_policies.html

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,18 @@
22
<h1>Execution policies</h1>
33
<cxx-section id="parallel.execpol.general">
44
<h1>In general</h1>
5-
<p>This clause describes classes that represent <dfn>execution policies</dfn>. An
6-
<dfn>execution policy</dfn> is an object that expresses the requirements on the ordering
7-
of functions invoked as a consequence of the invocation of a standard
8-
algorithm. Execution policies afford standard algorithms the discretion to
9-
execute in parallel.</p>
5+
<del3>
6+
<p>This clause describes classes that represent <dfn>execution policies</dfn>. An
7+
<dfn>execution policy</dfn> is an object that expresses the requirements on the ordering
8+
of functions invoked as a consequence of the invocation of a standard
9+
algorithm. Execution policies afford standard algorithms the discretion to
10+
execute in parallel.</p>
11+
</del3>
12+
<ins3>
13+
<p>This clause describes classes that are <dfn>execution policy</dfn> types. An object
14+
of an execution policy type indicates to an algorithm whether it is allowed to execute
15+
in parallel and expresses the requirements on the element access functions.</p>
16+
</ins3>
1017

1118
<cxx-example>
1219
<pre>std::vector&lt;int&gt; v = ...

general.html

Lines changed: 47 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,52 @@ <h1>Namespaces and headers</h1>
7272
</pre>
7373

7474
<cxx-section id="parallel.general.defns">
75-
<h1>Terms and definitions</h1>
76-
77-
<p>For the purposes of this document, the terms and definitions given in the C++ Standard and the following apply.</p>
78-
79-
<p>A <dfn>parallel algorithm</dfn> is a function template described by this Technical Specification declared in namespace <code>std::experimental::parallel<ins2>::v1</ins2></code> with a formal template parameter named <code>ExecutionPolicy</code>.</p>
80-
</cxx-section>
75+
<h1>Terms and definitions</h1>
76+
77+
<p>For the purposes of this document, the terms and definitions given in the C++ Standard and the following apply.</p>
78+
79+
<p>A <dfn>parallel algorithm</dfn> is a function template described by this Technical Specification declared in namespace <code>std::experimental::parallel<ins2>::v1</ins2></code> with a formal template parameter named <code>ExecutionPolicy</code>.</p>
80+
81+
82+
<p>
83+
<ins3>Parallel algorithms access objects indirectly accessible via their arguments by invoking the following functions:</ins3>
84+
85+
<ul>
86+
<li>
87+
<ins3>All operations of the categories of the iterators that the algorithm is instantiated with.</ins3>
88+
</li>
89+
90+
<li>
91+
<ins3>Functions on those sequence elements that are required by its specification.</ins3>
92+
</li>
93+
94+
<li>
95+
<ins3>User-provided function objects to be applied during the execution of the algorithm, if required by the specification.</ins3>
96+
</li>
97+
</ul>
98+
99+
<ins3>These functions are herein called <em>element access functions</em>.</ins3><pre>
100+
</pre>
101+
102+
<cxx-example>
103+
<ins3>The <code>sort</code> function may invoke the following element access functions:</ins3>
104+
105+
<ul>
106+
<li>
107+
<ins3>Methods of the random-access iterator of the actual template argument, as per 24.2.7, as implied by the name of the
108+
template parameters <code>RandomAccessIterator</code>.</ins3>
109+
</li>
110+
111+
<li>
112+
<ins3>The <code>swap</code> function on the elements of the sequence (as per 25.4.1.1 [sort]/2).</ins3>
113+
</li>
114+
115+
<li>
116+
<ins3>The user-provided <code>Compare</code> function object.</ins3>
117+
</li>
118+
</ul>
119+
</cxx-example>
120+
</p>
121+
</cxx-section>
81122
</cxx-clause>
82123

0 commit comments

Comments
 (0)