1
- = sycl_ext_oneapi_complex
1
+ = sycl_ext_oneapi_complex_marray
2
2
3
3
:source-highlighter: coderay
4
4
:coderay-linenums-mode: table
@@ -69,7 +69,7 @@ values, and construct complex marrays.
69
69
70
70
This extension provides a feature-test macro as described in the core SYCL
71
71
specification. An implementation supporting this extension must predefine the
72
- macro `SYCL_EXT_ONEAPI_MARRAY_COMPLEX ` to one of the values defined in the table
72
+ macro `SYCL_EXT_ONEAPI_COMPLEX_MARRAY ` to one of the values defined in the table
73
73
below. Applications can test for the existence of this macro to determine if
74
74
the implementation supports this feature, or applications can test the macro's
75
75
value to determine which of the extension's features the implementation
@@ -90,7 +90,9 @@ The `marray` class is specialized for the `sycl::ext::oneapi::complex`
90
90
class. The user interface of the `marray<sycl::ext::oneapi::complex, {N}>`
91
91
class is similar to the SYCL-2020 generic `marray` interface. Some logical,
92
92
bitwise, and arithmetic operators are deleted for the complex class as there is
93
- no equivalent.
93
+ no equivalent. The marray specialization builds on the
94
+ `sycl::ext::oneapi::complex` class, therfore this extension is dependent on
95
+ link:sycl_ext_oneapi_complex.asciidoc[sycl_ext_oneapi_complex].
94
96
95
97
The marray complex specialization is trivially copyable, and the type trait
96
98
`is_device_copyable` should resolve to `std::true_type`.
@@ -228,7 +230,7 @@ namespace oneapi {
228
230
```
229
231
230
232
The list of deleted operators are: %, %=, ++, --, +, -, &, |, ^, &=, |=, ^=,
231
- &&, ||, <<, >>, <<=, >>=, <, >, <= , >=, ~, !
233
+ &&, ||, <<, >>, <<=, >>=, <, >, +<=+ , >=, ~, !
232
234
233
235
The `make_complex_marray` free function is added to construct complex marrays from real and
234
236
imaginary components. Additionally, the free functions `get_real` and
@@ -277,10 +279,10 @@ namespace oneapi {
277
279
278
280
// return sequence of elements of component
279
281
template <class T, std::size_t NumElements, std::size_t... I>
280
- T get_real(const marray<sycl::ext::oneapi::complex<T>, NumElements> &input, std::integer_sequence<std::size_t, I...> int_seq);
282
+ marray<T, int_seq::size()> get_real(const marray<sycl::ext::oneapi::complex<T>, NumElements> &input, std::integer_sequence<std::size_t, I...> int_seq);
281
283
282
284
template <class T, std::size_t NumElements, std::size_t... I>
283
- T get_imag(const marray<sycl::ext::oneapi::complex<T>, NumElements> &input, std::integer_sequence<std::size_t, I...> int_seq);
285
+ marray<T, int_seq::size()> get_imag(const marray<sycl::ext::oneapi::complex<T>, NumElements> &input, std::integer_sequence<std::size_t, I...> int_seq);
284
286
285
287
// Set
286
288
@@ -307,7 +309,7 @@ namespace oneapi {
307
309
} // namespace sycl
308
310
```
309
311
310
- The class `sycl::oneapi::marray<complex<T>, N>`, has specializations
312
+ The class `sycl::ext:: oneapi::marray<sycl::ext::oneapi:: complex<T>, N>`, has specializations
311
313
of `T`; `float`, `double`, and `sycl::half` defined.
312
314
313
315
```C++
@@ -316,22 +318,23 @@ namespace ext {
316
318
namespace oneapi {
317
319
318
320
template <std::size_t NumElements>
319
- class marray<double, NumElements>;
321
+ class marray<sycl::ext::oneapi::complex< double> , NumElements>;
320
322
321
323
template <std::size_t NumElements>
322
- class marray<float, NumElements>;
324
+ class marray<sycl::ext::oneapi::complex< float> , NumElements>;
323
325
324
326
template <std::size_t NumElements>
325
- class marray<sycl::half, NumElements>;
327
+ class marray<sycl::ext::oneapi::complex<sycl:: half> , NumElements>;
326
328
327
329
} // namespace oneapi
328
330
} // namespace ext
329
331
} // namespace sycl
330
332
```
331
333
332
334
The generic type `mgencomplex` is defined as types
333
- `marray<complex<double>, {N}>`, `complex<complex<float>, {N}>`,
334
- `complex<complex<sycl::half>, {N}>`.
335
+ `marray<sycl::ext::oneapi::complex<double>, {N}>`,
336
+ `marray<sycl::ext::oneapi::complex<float>, {N}>`,
337
+ `marray<sycl::ext::oneapi::complex<sycl::half>, {N}>`.
335
338
336
339
The table below shows the free functions operating on the `marray` complex
337
340
specialized class. No table is provided for the `marray` class as only
@@ -376,7 +379,7 @@ functions are removed and the underlying function defintion stays the same.
376
379
|Set the real value of element idx in x to the decimal number y.
377
380
|`void set_imag(mgencomplex& x, std::size_t idx, const genfloat& y);`
378
381
|Set the imaginary value of element idx in x to the decimal number y.
379
-
382
+ |===
380
383
381
384
=== Mathematical operations
382
385
0 commit comments