Skip to content

Commit

Permalink
Fix nightlies -- workaround compiler bug in GCC 9.1 and 9.2 (kokkos#6118
Browse files Browse the repository at this point in the history
)

* Workaround compiler bug in GCC 9.1 and 9.2

* KOKKOS_COMPILER_GCC -> KOKKOS_COMPILER_GNU

Co-authored-by: Daniel Arndt <arndtd@ornl.gov>

* Update guards to use the workaround for GCC 9.0.1 as well

Co-authored-by: Nathan Ellingwood <ndellin@sandia.gov>

* Update comment to reflect more accurately what was done

---------

Co-authored-by: Daniel Arndt <arndtd@ornl.gov>
Co-authored-by: Nathan Ellingwood <ndellin@sandia.gov>
  • Loading branch information
3 people committed May 10, 2023
1 parent c62a42e commit 6b2459c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion core/unit_test/TestBitManipulationBuiltins.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,14 @@ struct TestBitCastFunction {
ASSERT_EQ(errors, 0) << "Failed check no error for bit_cast()";
}
template <typename To, typename From>
static KOKKOS_FUNCTION bool check(const From& from) {
#if defined(KOKKOS_COMPILER_GNU) && (900 <= KOKKOS_COMPILER_GNU) && \
(KOKKOS_COMPILER_GNU < 930)
// workaround compiler bug seen in GCC 9.0.1 and GCC 9.2.0
KOKKOS_FUNCTION bool check(const From& from) const
#else
static KOKKOS_FUNCTION bool check(const From& from)
#endif
{
using Kokkos::Experimental::bit_cast_builtin;
return bit_cast_builtin<From>(bit_cast_builtin<To>(from)) == from;
}
Expand Down

0 comments on commit 6b2459c

Please sign in to comment.