-
Notifications
You must be signed in to change notification settings - Fork 788
[SYCL] Add sycl complex implementation #6309
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
Conversation
I assume the heavy use of reserved identifiers is due to this being adjusted from the libc++ headers. Could you please change these to not use reserved identifiers? Preferably they should follow the LLVM Coding Standard. Note that we are discussing changing our naming in #2981, with using reserved identifiers being one of the discussed option. However, for now please refrain from using these. |
I discussed this offline with @aelovikov-intel and he made the point that it could be useful to be able to diff this and the libc++ variant in the future. We also agreed that even if we remove the use of reserved identifiers in this, then optimally it would be as a separate PR so if #2981 ends up with us encouraging the use of reserved identifiers we can revert it easily. To summarize, I am okay with leaving it as-is for now and potentially changing the identifiers separately. Maybe @againull or @bader have opinions on this. |
Okay, I am not too concerned with being able to diff this and the libc++ variant, so I do not have issues with removing the reserved identifiers. I do agree that if the identifiers are removed it should be a seperate PR, to make it easy to undo. |
This PR adds testing for the experimental sycl complex implementation. It tests math functions, `abs`, `acos`, `asin`, `atan`, `acosh`, `asinh`, `atanh`, `arg`, `conj`, `cos`, `cosh`, `exp`, `log`, `log10`, `norm`, `polar`, `pow`, `proj`, `sin`, `sinh`, `sqrt`, `tanh`, and `tanh`. Additionally it tests the math operators `+`, `-`, `/`, `*` and their assign equivalents. It also tests stream operations with `sycl::stream`, `std::istream`, and `std::ostream`. For simplicity the tests are broken into the test and a list of test cases. Each test is run for the complex type with `double`, `float`, and `sycl::half`. Results are compared to values from `std::complex`. Due to differences in error handling for the `pow` function between, libstdc++ and libc++(which the implementation is based on), testing of NAN's and INF's of pow is not done through comparison with `std::complex` but instead using expected values. Depends on: intel/llvm#6309
This PR adds testing for the experimental sycl complex implementation. It tests math functions, `abs`, `acos`, `asin`, `atan`, `acosh`, `asinh`, `atanh`, `arg`, `conj`, `cos`, `cosh`, `exp`, `log`, `log10`, `norm`, `polar`, `pow`, `proj`, `sin`, `sinh`, `sqrt`, `tanh`, and `tanh`. Additionally it tests the math operators `+`, `-`, `/`, `*` and their assign equivalents. It also tests stream operations with `sycl::stream`, `std::istream`, and `std::ostream`. For simplicity the tests are broken into the test and a list of test cases. Each test is run for the complex type with `double`, `float`, and `sycl::half`. Results are compared to values from `std::complex`. Due to differences in error handling for the `pow` function between, libstdc++ and libc++(which the implementation is based on), testing of NAN's and INF's of pow is not done through comparison with `std::complex` but instead using expected values. Depends on: intel#6309
This PR adds the sycl complex implementation of #6233. The implementation is based on llvm's
libc++
, but modified to use sycl builtins so it can be used within SYCL kernels.This approach means that this can run on any backend which has implemented the math built-ins, therefore adding complex support for CUDA.
This PR includes a test to validate correct return types based on the proposal.
llvm-test-suite: intel/llvm-test-suite#1058