1
1
===================================================================
2
- D0860r0 : Atomic Access Property for span and mdspan
2
+ P0860r0 : Atomic Access Property for span and mdspan
3
3
===================================================================
4
4
5
5
:Project: ISO JTC1/SC22/WG21: Programming Language C++
6
- :Number: D0860r0
7
- :Date: 2017-11-09
6
+ :Number: P0860r0
7
+ :Date: 2018-02-10
8
8
9
9
:Author: H\. Carter Edwards
10
10
@@ -28,7 +28,7 @@ Revision History
28
28
P0856r0
29
29
----------------------------------------------------------------------------
30
30
31
- 2017-11-08 Albuquerque LEWG feedback for P0009, P0019, and P0546
31
+ 2017-11-Albuquerque LEWG feedback for P0009, P0019, and P0546
32
32
33
33
- Extract atomic array reference from P0019 to a separate paper
34
34
@@ -37,15 +37,6 @@ P0856r0
37
37
Description / Motivation
38
38
******************************************************************
39
39
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
-
49
40
High performance computing (HPC) applications use very large arrays.
50
41
Computations with these arrays typically have distinct phases that
51
42
allocate and initialize members of the array,
@@ -68,33 +59,32 @@ in order to perform atomic operations on that object.
68
59
Construction of ``atomic_ref `` has potentially large overhead
69
60
which could be performed once for an entire span.
70
61
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
73
70
74
- - all references to elements are ``atomic_ref ``
71
+ - all references to `` mdspan `` elements are ``atomic_ref ``
75
72
- potential overhead associated with constructing ``atomic_ref ``
76
- occurs only once when the ``span `` or `` mdspan ``
73
+ occurs only once when an ``mdspan `` object
77
74
is constructed.
78
75
79
76
******************************************************************
80
77
Proposal
81
78
******************************************************************
82
79
83
- Modify ``span `` and `` mdspan `` specification:
80
+ Modify ``mdspan `` specification:
84
81
85
82
.. code-block :: c++
86
83
87
84
namespace std {
88
85
namespace experimental {
89
86
inline namespace fundamentals_v3 {
90
87
91
- template< class ArrayType , typename ... Properties >
92
- struct span {
93
- // revision
94
- // using reference = element_type & ; // remove
95
- using reference = /* implementation defined */ ;
96
- };
97
-
98
88
template< class ArrayType , typename ... Properties >
99
89
struct mdspan {
100
90
// revision
@@ -113,19 +103,15 @@ Add to **[views]** a new **[views.atomics]** section.
113
103
namespace std {
114
104
namespace experimental {
115
105
inline namespace fundamentals_v3 {
116
-
117
- struct atomic_access {
118
- using property_type = access_property;
119
- //...
120
- };
121
-
106
+
107
+ struct atomic_access ;
108
+
122
109
}}}
123
110
124
111
..
125
112
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 ``.
129
115
Let *S * be an instantiation of ``span `` or ``mdspan `` with
130
116
``Properties... `` parameter pack containing ``atomic_access ``.
131
117
Let *R * be ``atomic_ref< `` *S * ``::element_type> `` .
@@ -143,3 +129,28 @@ Let *R* be ``atomic_ref<`` *S* ``::element_type>`` .
143
129
- *S * iterator types dereference to ``atomic_ref< `` *S * ``::element_type> ``
144
130
145
131
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