-
Notifications
You must be signed in to change notification settings - Fork 407
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
Fixup absolute value of floating points in Kokkos complex #3882
Conversation
#ifdef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_SYCL | ||
using sycl::abs; | ||
using sycl::fabs; | ||
using sycl::sqrt; | ||
#else | ||
using std::abs; | ||
using std::fabs; | ||
using std::sqrt; | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this just be
using Kokkos::Experimental::fabs;
using Kokkos::Experimental::sqrt;
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixing in upcoming PR that will pull all the #ifdef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_SYCL
return Kokkos::complex<RealType>(t, i < RealType() ? -t : t); | ||
} else { | ||
RealType t = sqrt(2 * (abs(x) + abs(r))); | ||
RealType t = sqrt(2 * (abs(x) + fabs(r))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RealType t = sqrt(2 * (abs(x) + fabs(r))); | |
RealType t = sqrt(2 * (fabs(x) + fabs(r))); |
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. I did the same mistake before. x
is a Kokkos::complex
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks OK to me.
502865f
to
90fca96
Compare
No changes. Just rebased with autosquash |
As in #3880 motivated by removing SYCL specific preprocessor directives in
<Kokkos_Complex.hpp>
In the process discovered that we are using
std::fabs
in device functions which is not allowed with SYCL.