Skip to content

Commit

Permalink
[SYCL][DOC] Update the 'constraints' for the complex specification (#…
Browse files Browse the repository at this point in the history
…12649)

This PR apply the modifications asked in the
#11792 PR made by @Pennycook

---------

Co-authored-by: John Pennycook <john.pennycook@intel.com>
  • Loading branch information
jle-quel and Pennycook authored Feb 8, 2024
1 parent 4c8569c commit 170be1f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions sycl/doc/extensions/experimental/sycl_ext_oneapi_complex.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
:encoding: utf-8
:lang: en
:dpcpp: pass:[DPC++]
:endnote: &#8212;{nbsp}end{nbsp}note

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

The `T` template parameter must be one of the types float, double, or
sycl::half.
_Constraints_: The `T` template parameter must be one of the types `float`,
`double`, or `sycl::half`.

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

[_Note:_ The overloads of the functions `real(T)` and `imag(T)` match the
behavior in ISO C++ where `T` would be treated as a complex number with a zero
imaginary component. This is subject to the constraint that `T` must be one of
the types `float`, `double`, `sycl::half`, or evaluate to `true` for
`std::is_integral`.
_{endnote}_]

These functions are available in both host and device code, and each math
function should follow the C++ standard for handling `NaN` and `Inf` values.

Expand Down

0 comments on commit 170be1f

Please sign in to comment.