|
| 1 | += SYCL_EXT_ONEAPI_COMPLEX_ALGORITHMS |
| 2 | +:source-highlighter: coderay |
| 3 | +:coderay-linenums-mode: table |
| 4 | + |
| 5 | +// This section needs to be after the document title. |
| 6 | +:doctype: book |
| 7 | +:toc2: |
| 8 | +:toc: left |
| 9 | +:encoding: utf-8 |
| 10 | +:lang: en |
| 11 | + |
| 12 | +:blank: pass:[ +] |
| 13 | + |
| 14 | +// Set the default source code type in this document to C++, |
| 15 | +// for syntax highlighting purposes. This is needed because |
| 16 | +// docbook uses c++ and html5 uses cpp. |
| 17 | +:language: {basebackend@docbook:c++:cpp} |
| 18 | + |
| 19 | +== Introduction |
| 20 | +IMPORTANT: This specification is a draft. |
| 21 | + |
| 22 | +NOTE: Khronos(R) is a registered trademark and SYCL(TM) and SPIR(TM) are trademarks of The Khronos Group Inc. OpenCL(TM) is a trademark of Apple Inc. used by permission by Khronos. |
| 23 | + |
| 24 | +This extension adds limited support for `std::complex<float>` and |
| 25 | +`std::complex<double>` to several SYCL group functions and algorithms. |
| 26 | + |
| 27 | +== Notice |
| 28 | + |
| 29 | +Copyright (c) 2021-2022 Intel Corporation. All rights reserved. |
| 30 | + |
| 31 | +== Status |
| 32 | + |
| 33 | +Working Draft |
| 34 | + |
| 35 | +This is a proposed extension specification, intended to gather community |
| 36 | +feedback. Interfaces defined in this specification may not be implemented yet |
| 37 | +or may be in a preliminary state. The specification itself may also change in |
| 38 | +incompatible ways before it is finalized. Shipping software products should not |
| 39 | +rely on APIs defined in this specification. |
| 40 | + |
| 41 | +== Version |
| 42 | + |
| 43 | +Revision: 1 |
| 44 | + |
| 45 | +== Contacts |
| 46 | + |
| 47 | +John Pennycook, Intel (john 'dot' pennycook 'at' intel 'dot' com) |
| 48 | + |
| 49 | +== Dependencies |
| 50 | + |
| 51 | +This extension is written against the SYCL 2020 specification, Revision 4. |
| 52 | + |
| 53 | +== Feature Test Macro |
| 54 | + |
| 55 | +This extension provides a feature-test macro as described in the core SYCL |
| 56 | +specification section 6.3.3 "Feature test macros". Therefore, an |
| 57 | +implementation supporting this extension must predefine the macro |
| 58 | +`SYCL_EXT_ONEAPI_COMPLEX_ALGORITHMS` to one of the values defined in the table |
| 59 | +below. Applications can test for the existence of this macro to determine if |
| 60 | +the implementation supports this feature, or applications can test the macro's |
| 61 | +value to determine which of the extension's APIs the implementation supports. |
| 62 | + |
| 63 | +[%header,cols="1,5"] |
| 64 | +|=== |
| 65 | +|Value |Description |
| 66 | +|1 |Initial extension version. Base features are supported. |
| 67 | +|=== |
| 68 | + |
| 69 | +== Overview |
| 70 | + |
| 71 | +The types supported by some group functions and algorithms in SYCL 2020 are |
| 72 | +restricted to built-in scalar types and SYCL vector types. This extension |
| 73 | +relaxes these restrictions to permit `std::complex<float>` and |
| 74 | +`std::complex<double>` types. |
| 75 | + |
| 76 | +Note that the following group functions and algorithms already accept |
| 77 | +`std::complex<float>` arguments and `std::complex<double>` because they |
| 78 | +are trivially copyable: |
| 79 | + |
| 80 | +- `group_broadcast` |
| 81 | +- `group_shift_left` |
| 82 | +- `group_shift_right` |
| 83 | +- `permute_group_by_xor` |
| 84 | +- `select_from_group` |
| 85 | + |
| 86 | +Usage of `std::complex<double>` requires support for double precision, |
| 87 | +and specifically the `sycl::aspect::fp64` device aspect. |
| 88 | + |
| 89 | +== Extended Functions and Algorithms |
| 90 | + |
| 91 | +The following group functions and algorithms accept `std::complex<float>` |
| 92 | +and `std::complex<double>` arguments only when used with a `BinaryOperation` |
| 93 | +argument of `sycl::plus`: |
| 94 | + |
| 95 | +- `joint_reduce` |
| 96 | +- `reduce_over_group` |
| 97 | +- `joint_exclusive_scan` |
| 98 | +- `exclusive_scan_over_group` |
| 99 | +- `joint_inclusive_scan` |
| 100 | +- `inclusive_scan_over_group` |
| 101 | + |
| 102 | +NOTE: `sycl::multiplies` is not currently supported because it cannot be |
| 103 | +implemented as an element-wise operation on the real and imaginary components. |
| 104 | +This restriction may be lifted in a future version of the extension. |
| 105 | + |
| 106 | +NOTE: `sycl::bit_and`, `sycl::bit_or`, `sycl::bit_xor`, `sycl::logical_and`, |
| 107 | +`sycl::logical_or`, `sycl::minimum` and `sycl::maximum` are not supported |
| 108 | +because their behaviors are defined in terms of operators that `std::complex` |
| 109 | +does not implement. |
| 110 | + |
| 111 | +== Issues |
| 112 | + |
| 113 | +None. |
| 114 | + |
| 115 | +//. asd |
| 116 | +//+ |
| 117 | +//-- |
| 118 | +//*RESOLUTION*: Not resolved. |
| 119 | +//-- |
| 120 | +
|
| 121 | +== Revision History |
| 122 | +
|
| 123 | +[cols="5,15,15,70"] |
| 124 | +[grid="rows"] |
| 125 | +[options="header"] |
| 126 | +|======================================== |
| 127 | +|Rev|Date|Author|Changes |
| 128 | +|1|2021-12-08|John Pennycook|*Initial public working draft* |
| 129 | +|======================================== |
0 commit comments