Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SYCL][DOC] Update the 'constraints' for the complex specification #12649

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: —{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
Loading