Skip to content
This repository was archived by the owner on Sep 18, 2024. It is now read-only.

Commit 7f4f66e

Browse files
committed
Reduce atomic_access proposal to minimum scope and apply
property-value and property-type vocabulary.
1 parent d0999a3 commit 7f4f66e

File tree

1 file changed

+45
-34
lines changed

1 file changed

+45
-34
lines changed

proposals/P0860.rst

Lines changed: 45 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
===================================================================
2-
D0860r0 : Atomic Access Property for span and mdspan
2+
P0860r0 : Atomic Access Property for span and mdspan
33
===================================================================
44

55
:Project: ISO JTC1/SC22/WG21: Programming Language C++
6-
:Number: D0860r0
7-
:Date: 2017-11-09
6+
:Number: P0860r0
7+
:Date: 2018-02-10
88
99
:Author: H\. Carter Edwards
1010
@@ -28,7 +28,7 @@ Revision History
2828
P0856r0
2929
----------------------------------------------------------------------------
3030

31-
2017-11-08 Albuquerque LEWG feedback for P0009, P0019, and P0546
31+
2017-11-Albuquerque LEWG feedback for P0009, P0019, and P0546
3232

3333
- Extract atomic array reference from P0019 to a separate paper
3434

@@ -37,15 +37,6 @@ P0856r0
3737
Description / Motivation
3838
******************************************************************
3939

40-
Both ``span`` and ``mdspan`` allow for additional property parameters
41-
to be specified.
42-
The collections of all possible property parameters form an ontology
43-
**P0900** where the properties are grouped into orthogonal *property-types*.
44-
Properties with the property-type *access* allows ``span`` and ``mdspan``
45-
to tailor how referenced members are accessed.
46-
A ``span`` or ``mdspan`` can have at most one parameter with the
47-
*access* property-type.
48-
4940
High performance computing (HPC) applications use very large arrays.
5041
Computations with these arrays typically have distinct phases that
5142
allocate and initialize members of the array,
@@ -68,33 +59,32 @@ in order to perform atomic operations on that object.
6859
Construction of ``atomic_ref`` has potentially large overhead
6960
which could be performed once for an entire span.
7061

71-
We propose the property ``atomic_access`` with property-type *access* for
72-
``span`` and ``mdspan`` such that
62+
The proposed ``mdspan`` (**P0009**) allows for additional
63+
property parameters to be specified.
64+
Collections of property parameters form an ontology,
65+
described in **P0900**, where the *property-values* are organized
66+
into orthogonal *property-types*.
67+
68+
We propose the ``atomic_access`` property-value
69+
for ``span`` and ``mdspan`` such that
7370

74-
- all references to elements are ``atomic_ref``
71+
- all references to ``mdspan`` elements are ``atomic_ref``
7572
- potential overhead associated with constructing ``atomic_ref``
76-
occurs only once when the ``span`` or ``mdspan``
73+
occurs only once when an ``mdspan`` object
7774
is constructed.
7875

7976
******************************************************************
8077
Proposal
8178
******************************************************************
8279

83-
Modify ``span`` and ``mdspan`` specification:
80+
Modify ``mdspan`` specification:
8481

8582
.. code-block:: c++
8683

8784
namespace std {
8885
namespace experimental {
8986
inline namespace fundamentals_v3 {
9087

91-
template< class ArrayType , typename ... Properties >
92-
struct span {
93-
// revision
94-
// using reference = element_type & ; // remove
95-
using reference = /* implementation defined */ ;
96-
};
97-
9888
template< class ArrayType , typename ... Properties >
9989
struct mdspan {
10090
// revision
@@ -113,19 +103,15 @@ Add to **[views]** a new **[views.atomics]** section.
113103
namespace std {
114104
namespace experimental {
115105
inline namespace fundamentals_v3 {
116-
117-
struct atomic_access {
118-
using property_type = access_property;
119-
//...
120-
};
121-
106+
107+
struct atomic_access ;
108+
122109
}}}
123110

124111
..
125112
126-
The ``atomic_access`` property may appear at most once
127-
in the ``Properties...`` parameter pack of ``span`` or ``mdpsan``
128-
and no other property with the *access* property-type can be given.
113+
The ``atomic_access`` property-value may appear at most once
114+
in the ``Properties...`` parameter pack of ``span`` or ``mdpsan``.
129115
Let *S* be an instantiation of ``span`` or ``mdspan`` with
130116
``Properties...`` parameter pack containing ``atomic_access``.
131117
Let *R* be ``atomic_ref<`` *S* ``::element_type>`` .
@@ -143,3 +129,28 @@ Let *R* be ``atomic_ref<`` *S* ``::element_type>`` .
143129
- *S* iterator types dereference to ``atomic_ref<`` *S* ``::element_type>``
144130

145131

132+
******************************************************************
133+
Application to ``span``
134+
******************************************************************
135+
136+
When the ``span`` library is updated to accept properties (**P0546**)
137+
the same revision should be applied to accept the ``atomic_access``
138+
property-value.
139+
140+
.. code-block:: c++
141+
142+
namespace std {
143+
namespace experimental {
144+
inline namespace fundamentals_v3 {
145+
146+
template< class ArrayType , typename ... Properties >
147+
struct span {
148+
// revision
149+
// using reference = element_type & ; // remove
150+
using reference = /* implementation defined */ ;
151+
};
152+
153+
}}}
154+
155+
..
156+

0 commit comments

Comments
 (0)