Skip to content

[SYCL][Doc] Add sycl complex to complex algorithms extension #6717

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

Merged
merged 2 commits into from
Sep 9, 2022

Conversation

AidanBeltonS
Copy link
Contributor

This PR extends the complex algorithms extension to support sycl::ext::oneapi::complex and marray<sycl::ext::oneapi::complex>. Additionally it adds the multiplies operator as a valid binary operation for complex values when reducing and scanning across work items. This PR has a dependency upon #6550.

@AidanBeltonS AidanBeltonS requested a review from a team as a code owner September 7, 2022 13:40
Comment on lines +55 to +59
This extension builds on the `sycl::ext::oneapi::complex` and
`marray<sycl::ext::oneapi::complex>` classes. Therefore this extension is
dependent on link:sycl_ext_oneapi_complex.asciidoc[sycl_ext_oneapi_complex]
and
link:sycl_ext_oneapi_complex_marray.asciidoc[sycl_ext_oneapi_complex_marray].
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prior to this change, developers could use the std::complex features without requiring those other two extensions. Does anything in our std::complex support now depend on these new extensions? If not, I think we should be explicit that only those parts of this extension which use sycl::complex or marray are dependent.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, nothing in std::complex is dependent on these new extensions. I have added a bit stating that all function overloads that use std::complex are not dependent upon these extensions.

Comment on lines 102 to 105
Usage of `gencomplex` and `mgencomplex` with double value type requires support
for double precision, and specifically the `sycl::aspect::fp64` device aspect.
Similarly, usage of `gencomplex` and `mgencomplex` with half value type
requires support for half-precision, with `sycl::aspect::fp16`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: This is a little confusing to me, because gencomplex and mgencomplex refer to all the value types. "gencomplex with half value type" seems less precise than "sycl::complex<sycl::half> and sycl::marray<sycl::complex<sycl::half>>>".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed ya this is confusing. I have updated this bit to, hopefully, be much clearer.

Comment on lines +109 to +111
The following group functions and algorithms accept `gencomplex` arguments
only when used with a `BinaryOperation` argument of `sycl::plus` and
`sycl::multiplies`. These operations do not support `mgencomplex`:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change seems unrelated to the sycl::complex and sycl::marray parts of things. Can you say more about why you're lifting this restriction, and what SPIR-V instruction(s) you expect it to generate?

Copy link
Contributor Author

@AidanBeltonS AidanBeltonS Sep 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this change is somewhat unrelated to sycl::complex and sycl::marray<complex>, this restriction is being lifted to allow for a more fleshed out version of this extension. The multiplies operation is a valid binary operation for reductions and scans so we would like to support it. We currently do not have a valid SPIR-V instruction for the multiplies operation, so we would be adding a new one to support this op. I think we would name the instruction something along the lines of __spirv_GroupCMulKHR

Copy link
Contributor

@Pennycook Pennycook left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes LGTM. Thanks!

@bader bader merged commit 07c5b48 into intel:sycl Sep 9, 2022
@AidanBeltonS AidanBeltonS deleted the complex_algorithms branch September 21, 2022 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants