-
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
Add Kokkos::fma(x, y, z) math function (fused multiply-add) #5428
Conversation
This is for consistency with providing the same functions as <cmath> in namespace Kokkos, and important to ensure that eventual users of SIMD can use Kokkos::fma in templated code and get SIMD FMA instructions when expected
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.
Please add it there
// fma |
Also we need to add a unit test. Let me know if you are unable to or need help with it.
@@ -424,7 +424,7 @@ DEFINE_BINARY_FUNCTION_EVAL(copysign, 1); | |||
template <typename T, typename U, typename V> \ | |||
static KOKKOS_FUNCTION auto eval(T x, U y, V z) { \ | |||
static_assert( \ | |||
std::is_same<decltype(Kokkos::FUNC((T)0, (U)0), (V)0), \ | |||
std::is_same<decltype(Kokkos::FUNC((T)0, (U)0, (V)0)), \ |
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.
Uhoh ...
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.
The good old comma operator...
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.
Was going through the 2-arg version... Thanks for fixing
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.
I think this is good.
Adding reference to #4767 |
HIP failure on the new machine that I was setting up yesterday is clearly unrelated |
This is for consistency with providing
the same functions as in
namespace Kokkos, and important to
ensure that eventual users of SIMD
can use Kokkos::fma in templated code
and get SIMD FMA instructions when
expected