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

Fix bug {pow, log}(Kokkos::complex) #3866

Merged
merged 2 commits into from
Mar 22, 2021

Conversation

dalg24
Copy link
Member

@dalg24 dalg24 commented Mar 22, 2021

Fix #3865

Co-Authored-By: Vinh Dang <vqdang@sandia.gov>
@dalg24 dalg24 marked this pull request as ready for review March 22, 2021 03:38
@@ -720,7 +720,7 @@ KOKKOS_INLINE_FUNCTION Kokkos::complex<RealType> pow(const complex<RealType>& x,
using std::pow;
using std::sin;
#endif
RealType phi = atan(x.imag() / x.real());
RealType phi = atan2(x.imag(), x.real());
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't you also have to import sycl::atan2 instead of sycl::atan and std::atan2 instead of syd::atan?

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.
Note that we should really be using the math functions from Kokkos::Experimental::

Co-Authored-By: Vinh Dang <vqdang@sandia.gov>
Copy link
Contributor

@masterleinad masterleinad left a comment

Choose a reason for hiding this comment

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

Looks OK.

@crtrott crtrott merged commit c2f1324 into kokkos:develop Mar 22, 2021
@dalg24 dalg24 deleted the bug_log_and_pow_complex branch March 22, 2021 17:50
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.

None yet

3 participants