Use experimental complex extension for all complex arithmetic
With current nightly compiler, dpctl will fail to link when built for HIP backend due to undefined symbols (i.e., __muldc3).
Since compiler does not support arithmetic with std::complex on HIP backend, this PR takes the steps to refactor complex arithmetic throughout tensor library
-
libtensor/include/kernels/elementwise_functions/sycl_complex.hppis now moved tolibtensor/include/utils/sycl_complex.hppand refactored to definedsycl_complex_t<T>, aliasing the complex type defined in the extension -
sycl_complex.hppstill indirectly setsSYCL_EXT_ONEAPI_COMPLEXand includes the header for experimental extension, but no longer definesexprm_nsnamespace alias. This is now left to individual files. - All uses of
std::real,std::imag, etc. have been removed -
sycl_utils.hppnow defines new custom functors a laMaximumandMinimum,PlusandMultiplies. These structs are used by accumulation operations (sum,cumulative_sum, GEMM, etc.). They perform casting ofstd::complexinputs to SYCL equivalent, perform operations, and then return asstd::complex - Several element-wise functions are updated to properly perform operations in SYCL complex type
- [ ] Have you provided a meaningful PR description?
- [ ] Have you added a test, reproducer or referred to an issue with a reproducer?
- [ ] Have you tested your changes locally for CPU and GPU devices?
- [ ] Have you made sure that new changes do not introduce compiler warnings?
- [ ] Have you checked performance impact of proposed changes?
- [ ] Have you added documentation for your changes, if necessary?
- [ ] Have you added your changes to the changelog?
- [ ] If this PR is a work in progress, are you opening the PR as a draft?
View rendered docs @ https://intelpython.github.io/dpctl/pulls/2069/index.html
Array API standard conformance tests for dpctl=0.20.0dev0=py310h93fe807_183 ran successfully. Passed: 1108 Failed: 4 Skipped: 119
Array API standard conformance tests for dpctl=0.20.0dev0=py310h93fe807_183 ran successfully. Passed: 1109 Failed: 3 Skipped: 119