Skip to content

Commit 170be1f

Browse files
jle-quelPennycook
andauthored
[SYCL][DOC] Update the 'constraints' for the complex specification (#12649)
This PR apply the modifications asked in the #11792 PR made by @Pennycook --------- Co-authored-by: John Pennycook <[email protected]>
1 parent 4c8569c commit 170be1f

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

sycl/doc/extensions/experimental/sycl_ext_oneapi_complex.asciidoc

+10-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
:encoding: utf-8
1111
:lang: en
1212
:dpcpp: pass:[DPC++]
13+
:endnote: &#8212;{nbsp}end{nbsp}note
1314

1415
// Set the default source code type in this document to C++,
1516
// for syntax highlighting purposes. This is needed because
@@ -101,8 +102,8 @@ available only in host code as noted below.
101102
The complex type is trivially copyable and type trait `is_device_copyable`
102103
should resolve to `std::true_type`.
103104

104-
The `T` template parameter must be one of the types float, double, or
105-
sycl::half.
105+
_Constraints_: The `T` template parameter must be one of the types `float`,
106+
`double`, or `sycl::half`.
106107

107108
Note: When performing operations between complex numbers and decimals,
108109
the decimal is treated as a complex number with a real component equal to
@@ -335,6 +336,13 @@ Additionally, this extension introduces support for the `real` and `imag` free
335336
functions, which returns the real and imaginary component of a number,
336337
respectively.
337338

339+
[_Note:_ The overloads of the functions `real(T)` and `imag(T)` match the
340+
behavior in ISO C++ where `T` would be treated as a complex number with a zero
341+
imaginary component. This is subject to the constraint that `T` must be one of
342+
the types `float`, `double`, `sycl::half`, or evaluate to `true` for
343+
`std::is_integral`.
344+
_{endnote}_]
345+
338346
These functions are available in both host and device code, and each math
339347
function should follow the C++ standard for handling `NaN` and `Inf` values.
340348

0 commit comments

Comments
 (0)