@@ -40,7 +40,7 @@ This extension is written against the SYCL 2020 revision 5 specification. All
40
40
references below to the "core SYCL specification" or to section numbers in the
41
41
SYCL specification refer to that revision.
42
42
43
- The marray specialization builds on the `sycl::ext::oneapi::complex` class,
43
+ The complex marray extension builds on the `sycl::ext::oneapi::complex` class,
44
44
therefore this extension is dependent on
45
45
link:sycl_ext_oneapi_complex.asciidoc[sycl_ext_oneapi_complex].
46
46
@@ -62,7 +62,7 @@ This extension is not currently implemented in {dpcpp}.
62
62
== Overview
63
63
64
64
{dpcpp} has support for `sycl::ext::oneapi::complex` this allows for the
65
- addition of new complex math features. This proposes the specialization of
65
+ addition of new complex math features. This proposes the instantiation of
66
66
`marray` to add support for complex numbers to be stored in arrays. The
67
67
proposal includes overloading the existing math functions to support complex
68
68
marrays and adding new free functions to simplify accessing, setting marray
@@ -91,156 +91,27 @@ supports.
91
91
92
92
=== Marray Complex Class Specialization
93
93
94
- The `marray` class is specialized for the `sycl::ext::oneapi::complex`
95
- class. The user interface of the `marray<sycl::ext::oneapi::complex, {N}>`
96
- class is similar to the SYCL-2020 generic `marray` interface. Some logical,
97
- bitwise, and arithmetic operators are deleted for the complex class as there is
98
- no equivalent.
94
+ The `marray` class is extended for the `sycl::ext::oneapi::complex` class.
95
+ The user interface of the `marray<sycl::ext::oneapi::complex, {N}>`
96
+ class is not changed compared to the SYCL-2020 generic `marray` interface.
99
97
100
- The marray complex specialization is trivially copyable, and the type trait
101
- `is_device_copyable` should resolve to `std::true_type`.
98
+ The ` marray` complex instantiation is trivially copyable, and the type
99
+ trait `is_device_copyable` should resolve to `std::true_type`.
102
100
103
- ```C++
104
- namespace sycl {
105
- namespace ext {
106
- namespace oneapi {
107
-
108
- // Specialization of exiting `marray` class for `sycl::ext::oneapi::complex`
109
- template <typename T, std::size_t NumElements>
110
- class marray <sycl::ext::oneapi::complex<T>, NumElements> {
111
- private:
112
- using DataT = sycl::ext::oneapi::complex<T>;
113
- public:
114
- using value_type = DataT;
115
- using reference = DataT&;
116
- using const_reference = const DataT&;
117
- using iterator = DataT*;
118
- using const_iterator = const DataT*;
119
-
120
- marray();
121
-
122
- explicit constexpr marray(const DataT &arg);
123
-
124
- template <typename... ArgTN>
125
- constexpr marray(const ArgTN&... args);
126
-
127
- constexpr marray(const marray<DataT, NumElements> &rhs);
128
- constexpr marray(marray<DataT, NumElements> &&rhs);
129
-
130
- // Available only when: NumElements == 1
131
- operator DataT() const;
132
-
133
- static constexpr std::size_t size() noexcept;
134
-
135
- // subscript operator
136
- reference operator[](std::size_t index);
137
- const_reference operator[](std::size_t index) const;
138
-
139
- marray &operator=(const marray<DataT, NumElements> &rhs);
140
- marray &operator=(const DataT &rhs);
141
-
142
- // iterator functions
143
- iterator begin();
144
- const_iterator begin() const;
145
-
146
- iterator end();
147
- const_iterator end() const;
148
-
149
- // OP is: +, -, *, /
150
- friend marray operatorOP(const marray &lhs, const marray &rhs) { /* ... */ }
151
- friend marray operatorOP(const marray &lhs, const DataT &rhs) { /* ... */ }
152
-
153
- // OP is: %
154
- friend marray operatorOP(const marray &lhs, const DataT &rhs) = delete;
155
-
156
- // OP is: +=, -=, *=, /=
157
- friend marray &operatorOP(marray &lhs, const marray &rhs) { /* ... */ }
158
- friend marray &operatorOP(marray &lhs, const DataT &rhs) { /* ... */ }
159
-
160
- // OP is: %=
161
- friend marray &operatorOP(marray &lhs, const marray &rhs) = delete;
162
- friend marray &operatorOP(marray &lhs, const DataT &rhs) = delete;
163
-
164
- // OP is prefix ++, --
165
- friend marray &operatorOP(marray &rhs) = delete;
166
-
167
- // OP is postfix ++, --
168
- friend marray operatorOP(marray& lhs, int) = delete;
169
-
170
- // OP is unary +, -
171
- friend marray operatorOP(marray &rhs) = delete;
172
-
173
- // OP is: &, |, ^
174
- friend marray operatorOP(const marray &lhs, const marray &rhs) = delete;
175
- friend marray operatorOP(const marray &lhs, const DataT &rhs) = delete;
176
-
177
- // OP is: &=, |=, ^=
178
- friend marray &operatorOP(marray &lhs, const marray &rhs) = delete;
179
- friend marray &operatorOP(marray &lhs, const DataT &rhs) = delete;
180
-
181
- // OP is: &&, ||
182
- friend marray<bool, NumElements> operatorOP(const marray &lhs, const marray &rhs) = delete;
183
- friend marray<bool, NumElements> operatorOP(const marray& lhs, const DataT &rhs) = delete;
184
-
185
- // OP is: <<, >>
186
- friend marray operatorOP(const marray &lhs, const marray &rhs) = delete;
187
- friend marray operatorOP(const marray &lhs, const DataT &rhs) = delete;
188
-
189
- // OP is: <<=, >>=
190
- friend marray &operatorOP(marray &lhs, const marray &rhs) = delete;
191
- friend marray &operatorOP(marray &lhs, const DataT &rhs) = delete;
192
-
193
- // OP is: ==, !=
194
- friend marray<bool, NumElements> operatorOP(const marray &lhs, const marray &rhs) {
195
- /* ... */ }
196
- friend marray<bool, NumElements> operatorOP(const marray &lhs, const DataT &rhs) {
197
- /* ... */ }
198
-
199
- // OP is: <, >, <=, >=
200
- friend marray<bool, NumElements> operatorOP(const marray &lhs, const marray &rhs) = delete;
201
- friend marray<bool, NumElements> operatorOP(const marray &lhs, const DataT &rhs) = delete;
202
-
203
- friend marray operator~(const marray &v) = delete;
204
-
205
- // OP is: +, -, *, /
206
- friend marray operatorOP(const DataT &lhs, const marray &rhs) { /* ... */ }
207
-
208
- // OP is: %
209
- friend marray operatorOP(const DataT &lhs, const marray &rhs) = delete;
210
-
211
- // OP is: &, |, ^
212
- friend marray operatorOP(const DataT &lhs, const marray &rhs) = delete;
213
-
214
- // OP is: &&, ||
215
- friend marray<bool, NumElements> operatorOP(const DataT &lhs, const marray &rhs) = delete;
216
-
217
- // OP is: <<, >>
218
- friend marray operatorOP(const DataT &lhs, const marray &rhs) = delete;
219
-
220
- // OP is: ==, !=
221
- friend marray<bool, NumElements> operatorOP(const DataT &lhs, const marray &rhs) {
222
- /* ... */ }
223
-
224
- // OP is: <, >, <=, >=
225
- friend marray<bool, NumElements> operatorOP(const DataT &lhs, const marray &rhs) = delete;
226
-
227
- friend marray<bool, NumElements> operator!(const marray &v) = delete;
228
- }
229
-
230
- } // namespace oneapi
231
- } // namespace ext
232
- } // namespace sycl
233
- ```
234
-
235
- The list of deleted operators are: %, %=, ++, --, +, -, &, |, ^, &=, |=, ^=,
236
- &&, ||, <<, >>, <<=, >>=, <, >, +<=+, >=, ~, !
101
+ As the `marray` class is not specialized in this proposal. The `marray`
102
+ definition used within this proposal assumes that any operator the `marray`
103
+ class defines is only implemented if the marray's value type also
104
+ implements the operator. So, for example, `marray<float, N>` does not
105
+ implement the modulus operator as float does not support it. As the
106
+ `marray` class is not changed in this proposal, it is not redefined below.
237
107
238
- The `make_complex_marray` free function is added to construct complex marrays from real and
239
- imaginary components. Additionally, the free functions `get_real` and
240
- `get_imag` are added to access the real and imaginary components of the
241
- `marray` class without modifying the existing `marray` interface. The usage
242
- of free functions does cause a deviation from the `std::complex` interface.
243
- However, it does reduce this extensions impact on the `marray` interface.
108
+ The `make_complex_marray` free function is added to construct complex
109
+ marrays from real and imaginary components. Additionally, the free
110
+ functions `get_real` and `get_imag` are added to access the real and
111
+ imaginary components of the `marray` class without modifying the existing
112
+ `marray` interface. The usage of free functions does cause a deviation
113
+ from the `std::complex` interface. However, it does reduce this extensions
114
+ impact on the `marray` interface.
244
115
245
116
```C++
246
117
namespace sycl {
@@ -299,8 +170,8 @@ namespace oneapi {
299
170
} // namespace sycl
300
171
```
301
172
302
- The class `sycl::ext::oneapi::marray<sycl::ext::oneapi::complex<T>, N>`, has specializations
303
- of `T`; `float`, `double`, and `sycl::half` defined .
173
+ The class `sycl::ext::oneapi::marray<sycl::ext::oneapi::complex<T>, N>`,
174
+ has instantiations of `T`; `float`, `double`, and `sycl::half` declared .
304
175
305
176
```C++
306
177
namespace sycl {
@@ -327,8 +198,8 @@ The generic type `mgencomplex` is defined as types
327
198
`marray<sycl::ext::oneapi::complex<sycl::half>, {N}>`.
328
199
329
200
The table below shows the free functions operating on the `marray` complex
330
- specialized class. No table is provided for the `marray` class as only
331
- functions are removed and the underlying function defintion stays the same .
201
+ class. No table is provided for the `marray` class as no changes to it are
202
+ proposed .
332
203
333
204
[%header,cols="5,5"]
334
205
|===
0 commit comments