[SYCL] Augment known_identity for std::complex and std::plus.#8425
[SYCL] Augment known_identity for std::complex and std::plus.#8425steffenlarsen merged 5 commits intointel:syclfrom
Conversation
sycl/include/sycl/known_identity.hpp
Outdated
| bool_constant<std::is_same<T, std::complex<short>>::value || | ||
| std::is_same<T, std::complex<int>>::value || |
There was a problem hiding this comment.
Why do we have these two instantiations of std::complex<> for integral T?
I've only ever seen std::complex<float>, std::complex<double> and std::complex<long double>. Both sycl_ext_oneapi_complex and sycl_ext_oneapi_complex_algorithms only support float, double and sycl::half.
There was a problem hiding this comment.
Thanks for bringing this up. I wasn't aware that for std::complex, we only support float and double types. I've accordingly made the changes.
|
Do we need to update any extensions with new wording? |
I'm not sure but I think update to sycl_ext_oneapi_complex_algorithms.asciidoc is not required as it already introduces std::complex and std::complex to reduce and reduce_over_group algorithms. |
SYCL 2020 says:
Since the intent of this trait is to let people test which types an implementation can reason about, it seems redundant to also put that information into an extension specification. But I might just be feeling lazy, so I'd like @gmlueck's opinion on this. |
I think it's worthwhile to add this to the extension specification. The core SYCL spec has Table 123 "Known identities", which lists the operators that have known identifies for certain types. It would make sense for our extension spec to list extended cases that have known identities. BTW, sycl_ext_oneapi_complex_algorithms is listed as "proposed". Is this implemented now? If so, it should be moved to either "experimental" or "supported" as appropriate (and it should be updated to note its current status). |
…ties to std::complex
Sure, thanks for the feedback. I've updated the extension specification as well. @Pennycook please review the changes.
I don't know if sycl_ext_oneapi_complex_algorithms is completely implemented. |
Do either of you know? I'm wondering if we just forgot to move the extension specification. |
sycl/doc/extensions/proposed/sycl_ext_oneapi_complex_algorithms.asciidoc
Outdated
Show resolved
Hide resolved
sycl_ext_oneapi_complex_algorithms says that it depends on two other extensions. The first is sycl_ext_oneapi_complex, which is still showing as "proposed". The second is sycl_ext_oneapi_marray, which hasn't actually been merged yet: #6550 |
aelovikov-intel
left a comment
There was a problem hiding this comment.
SYCL RT changes LGTM.
|
@intel/llvm-gatekeepers The PR is ready! |
|
CUDA Failed Tests (1): |
This PR adds test case for testing identityless reduction for complex numbers. Corresponding intel/llvm PR: intel/llvm#8425
This PR adds test case for testing identityless reduction for complex numbers. Corresponding intel/llvm PR: intel#8425
This PR proposes to augment sycl::has_known_identity to return true for std::complex and std::plus operator. This will have two benefits:
Also, this PR addresses the Github issue #5477.
Test Case PR: intel/llvm-test-suite#1609