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

Add Kokkos::fma(x, y, z) math function (fused multiply-add) #5428

Merged
merged 5 commits into from
Sep 7, 2022

Conversation

ibaned
Copy link
Contributor

@ibaned ibaned commented Sep 6, 2022

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

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
Copy link
Member

@dalg24 dalg24 left a 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

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)), \
Copy link
Member

Choose a reason for hiding this comment

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

Uhoh ...

Copy link
Contributor Author

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...

Copy link
Member

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

Copy link
Member

@crtrott crtrott left a 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.

@dalg24
Copy link
Member

dalg24 commented Sep 7, 2022

Adding reference to #4767

@dalg24
Copy link
Member

dalg24 commented Sep 7, 2022

HIP failure on the new machine that I was setting up yesterday is clearly unrelated

@dalg24 dalg24 merged commit a58c622 into kokkos:develop Sep 7, 2022
@dalg24 dalg24 changed the title adding Kokkos::fma(x, y, z) Add Kokkos::fma(x, y, z) math function (fused multiple-add) Sep 7, 2022
@dalg24 dalg24 changed the title Add Kokkos::fma(x, y, z) math function (fused multiple-add) Add Kokkos::fma(x, y, z) math function (fused multiply-add) Sep 7, 2022
@ibaned ibaned deleted the fma-function branch September 7, 2022 15:07
@dalg24 dalg24 mentioned this pull request Sep 7, 2022
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