Skip to content

Commit

Permalink
guards to ensure DBL_EPSILON return for POWER8,9
Browse files Browse the repository at this point in the history
  • Loading branch information
Amy Powell committed Oct 5, 2023
1 parent 4ce289b commit 4d3958b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion core/unit_test/TestMathematicalFunctions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,15 @@ struct FloatingPointComparison {
#endif
KOKKOS_FUNCTION
double eps(float) const { return FLT_EPSILON; }
// POWER9 gives unexpected values with LDBL_EPSILON issues
// https://stackoverflow.com/questions/68960416/ppc64-long-doubles-machine-epsilon-calculation
#if defined(KOKKOS_ARCH_POWER9) || defined(KOKKOS_ARCH_POWER8)
KOKKOS_FUNCTION
double eps(long double) const { return DBL_EPSILON; }
#else
KOKKOS_FUNCTION
double eps(long double) const { return LDBL_EPSILON; }

#endif
// Using absolute here instead of abs, since we actually test abs ...
template <class T>
KOKKOS_FUNCTION std::enable_if_t<std::is_signed<T>::value, T> absolute(
Expand Down

0 comments on commit 4d3958b

Please sign in to comment.