Skip to content

Commit 7677eea

Browse files
committed
Merge pull request #47 from cplusplus/D4505
D4505
2 parents 0882411 + ce24efc commit 7677eea

6 files changed

+215
-118
lines changed

README.md

+16-7
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,30 @@
1-
Document Number: N4408
2-
Date: 2015-04-10
1+
Document Number: N4506
2+
Date: 2015-05-05
33
Revises:
44
Project: Programming Language C++
55
Project Number: TS 19570
66
Reply-to: Jared Hoberock
77
NVIDIA Corporation
88
jhoberock@nvidia.com
99

10-
# Parallelism TS Editor's Report, pre-Lenexa mailing
10+
# Parallelism TS Editor's Report, post-Lenexa mailing
1111

12-
N4407 is the latest Parallelism TS Working Draft. It contains editorial changes to the Parallelism TS to address whitespace and other formatting issues.
12+
N4505 is the latest Parallelism TS Working Draft. It contains editorial and technical changes to the Parallelism TS to apply the following revisions:
1313

14-
N4407 updates the previous draft, N4352, published in the midterm mailing.
14+
* N4274 - Relaxing Packing Rules for Exceptions Thrown by Parallel Algorithms - Proposed Wording (Revision 1)
15+
* Feature test macro for the Parallelism TS
1516

16-
N4409 is document N4407 reformatted as a TS document. It updates N4354, which was published in the midterm mailing.
17+
N4505 updates the previous draft, N4407, published in the pre-Lenexa mailing.
18+
19+
N4507 is document N4505 reformatted as a TS document. It updates N4409, which was published in the pre-Lenexa mailing.
20+
21+
## Technical Changes
22+
23+
* Applied N4274, which relaxes the exception packaging rules for exceptions thrown by parallel algorithms. Additionally, changed instances of "terminates with (exception)" phrasing to "exits via (exception)", as directed by the Library Working Group.
24+
25+
* Introduced the feature test macro `__cpp_lib_experimental_parallel_algorithm` for the functionality of the Parallelism TS as directed by SG1.
1726

1827
## Editorial Changes
1928

20-
Eliminated spurious whitespace and paragraph numbers and manually broke code lines which were spilling into the margin.
29+
* Promoted subsection 1.3.1, which was incorrectly grouped under section 1.3, to section 1.4.
2130

exceptions.html

+12-11
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ <h1>Exception reporting behavior</h1>
99
</p>
1010
<p>
1111
During the execution of a standard parallel algorithm, if the invocation of an element access function
12-
terminates with an uncaught exception, the behavior of the program is determined by the type of
12+
<ins>exits via</ins><del>terminates with</del> an uncaught exception, the behavior of the program is determined by the type of
1313
execution policy used to invoke the algorithm:
1414

1515
<ul>
@@ -19,29 +19,30 @@ <h1>Exception reporting behavior</h1>
1919
</li>
2020
<li>
2121
If the execution policy object is of type <code>sequential_execution_policy</code> or
22-
<code>parallel_execution_policy</code>, the execution of the algorithm terminates with an
23-
<code>exception_list</code> exception. All uncaught exceptions thrown during
24-
the invocations of element access functions shall be contained in the
25-
<code>exception_list</code>.<pre>
22+
<code>parallel_execution_policy</code>, the execution of the algorithm <ins>exits via</ins><del>terminates with</del> an
23+
<del><code>exception_list</code></del> exception. <ins>The exception shall be an <code>exception_list</code> containing all</ins><del>All</del> uncaught exceptions thrown during
24+
the invocations of element access functions<ins>, or optionally the uncaught exception if there was only one</ins><del>shall be contained in the
25+
<code>exception_list</code></del>.<pre>
2626
</pre>
2727

2828
<cxx-note>
29-
For example, the number of invocations of the user-provided function object in
30-
<code>for_each</code> is unspecified. When <code>for_each</code> is executed sequentially,
31-
only one exception will be contained in the <code>exception_list</code> object.
29+
For example, <del>the number of invocations of the user-provided function object in
30+
<code>for_each</code> is unspecified. W</del><ins>w</ins>hen <code>for_each</code> is executed sequentially,
31+
<ins>if an invocation of the user-provided function object throws an exception, <code>for_each</code> can exit via the uncaught exception, or throw an <code>exception_list</code> containing the original exception.
32+
<del>only one exception will be contained in the <code>exception_list</code> object.</del>
3233
</cxx-note><pre>
3334
</pre>
3435

3536
<cxx-note>
3637
These guarantees imply that, unless the algorithm has failed to allocate memory and
37-
terminated with <code>std::bad_alloc</code>, all exceptions thrown during the execution of
38+
<ins>exits via</ins><del>terminated with</del> <code>std::bad_alloc</code>, all exceptions thrown during the execution of
3839
the algorithm are communicated to the caller. It is unspecified whether an algorithm implementation will "forge ahead" after
3940
encountering and capturing a user exception.
4041
</cxx-note><pre>
4142
</pre>
4243
<cxx-note>
43-
The algorithm may terminate with the <code>std::bad_alloc</code> exception even if one or more
44-
user-provided function objects have terminated with an exception. For example, this can happen when an algorithm fails to allocate memory while
44+
The algorithm may <ins>exit via</ins><del>terminate with</del> the <code>std::bad_alloc</code> exception even if one or more
45+
user-provided function objects have <ins>exited via</ins><del>terminated with</del> an exception. For example, this can happen when an algorithm fails to allocate memory while
4546
creating or adding elements to the <code>exception_list</code> object.
4647
</cxx-note>
4748
</li>

front_matter.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<cxx-titlepage stage="draft">
2-
<cxx-docnum>N4407</cxx-docnum>
2+
<cxx-docnum>N4505</cxx-docnum>
33
<cxx-project-number>19570</cxx-project-number>
4-
<time pubdate="">2015-04-10</time>
5-
<cxx-revises><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4352.html">N4352</a></cxx-revises>
4+
<time pubdate="">2015-05-05</time>
5+
<cxx-revises><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4407.html">N4407</a></cxx-revises>
66
<cxx-editor>
77
Jared Hoberock<br/>
88
NVIDIA Corporation<br/>

general.html

+69-31
Original file line numberDiff line numberDiff line change
@@ -70,51 +70,89 @@ <h1>Namespaces and headers</h1>
7070
<pre>
7171
<code> #include &lt;meow&gt;</code>
7272
</pre>
73+
</cxx-section>
7374

74-
<cxx-section id="parallel.general.defns">
75-
<h1>Terms and definitions</h1>
75+
<cxx-section id="parallel.general.defns">
76+
<h1>Terms and definitions</h1>
77+
78+
<p>For the purposes of this document, the terms and definitions given in the C++ Standard and the following apply.</p>
79+
80+
<p>A <dfn>parallel algorithm</dfn> is a function template described by this Technical Specification declared in namespace <code>std::experimental::parallel::v1</code> with a formal template parameter named <code>ExecutionPolicy</code>.</p>
7681

77-
<p>For the purposes of this document, the terms and definitions given in the C++ Standard and the following apply.</p>
82+
<p>
83+
Parallel algorithms access objects indirectly accessible via their arguments by invoking the following functions:
7884

79-
<p>A <dfn>parallel algorithm</dfn> is a function template described by this Technical Specification declared in namespace <code>std::experimental::parallel::v1</code> with a formal template parameter named <code>ExecutionPolicy</code>.</p>
85+
<ul>
86+
<li>
87+
All operations of the categories of the iterators that the algorithm is instantiated with.
88+
</li>
8089

81-
<p>
82-
Parallel algorithms access objects indirectly accessible via their arguments by invoking the following functions:
90+
<li>
91+
Functions on those sequence elements that are required by its specification.
92+
</li>
93+
94+
<li>
95+
User-provided function objects to be applied during the execution of the algorithm, if required by the specification.
96+
</li>
97+
98+
<ins><li>
99+
Operations on those function objects required by the specification.
100+
101+
<cxx-note>
102+
See clause 25.1 of <em>C++ Standard Algorithms Library</em>.
103+
</cxx-note>
104+
</li></ins>
105+
</ul>
106+
107+
These functions are herein called <em>element access functions</em>.
108+
109+
<cxx-example>
110+
The <code>sort</code> function may invoke the following element access functions:
83111

84112
<ul>
85113
<li>
86-
All operations of the categories of the iterators that the algorithm is instantiated with.
114+
Methods of the random-access iterator of the actual template argument, as per 24.2.7, as implied by the name of the
115+
template parameters <code>RandomAccessIterator</code>.
87116
</li>
88117

89118
<li>
90-
Functions on those sequence elements that are required by its specification.
119+
The <code>swap</code> function on the elements of the sequence (as per 25.4.1.1 [sort]/2).
91120
</li>
92121

93122
<li>
94-
User-provided function objects to be applied during the execution of the algorithm, if required by the specification.
123+
The user-provided <code>Compare</code> function object.
95124
</li>
96125
</ul>
97-
98-
These functions are herein called <em>element access functions</em>.
99-
100-
<cxx-example>
101-
The <code>sort</code> function may invoke the following element access functions:
102-
103-
<ul>
104-
<li>
105-
Methods of the random-access iterator of the actual template argument, as per 24.2.7, as implied by the name of the
106-
template parameters <code>RandomAccessIterator</code>.
107-
</li>
108-
109-
<li>
110-
The <code>swap</code> function on the elements of the sequence (as per 25.4.1.1 [sort]/2).
111-
</li>
112-
113-
<li>
114-
The user-provided <code>Compare</code> function object.
115-
</li>
116-
</ul>
117-
</cxx-example>
118-
</cxx-section>
126+
</cxx-example>
127+
</cxx-section>
128+
129+
<cxx-section id="parallel.general.features">
130+
<ins>
131+
<h1>Feature-testing recommendations</h1>
132+
<p>An implementation that provides support for this Technical Specification shall define the feature test macro(s) in Table 1.</p>
133+
134+
<table is="cxx-table" class="column-rules">
135+
<caption>Feature Test Macro(s)</caption>
136+
137+
<thead>
138+
<tr>
139+
<th>Name</th>
140+
<th>Value</th>
141+
<th>Header</th>
142+
</tr>
143+
<tr>
144+
<td><code>__cpp_lib_experimental_parallel_algorithm</code></td>
145+
<td>201505</td>
146+
<td>
147+
<code>&lt;experimental/algorithm&gt;</code><br>
148+
<code>&lt;experimental/exception_list&gt;</code><br>
149+
<code>&lt;experimental/execution_policy&gt;</code><br>
150+
<code>&lt;experimental/numeric&gt;</code>
151+
</td>
152+
</tr>
153+
</thead>
154+
</table>
155+
</ins>
156+
</cxx-section>
119157
</cxx-clause>
120158

0 commit comments

Comments
 (0)