Skip to content

Commit

Permalink
sacado: workaround icpc ice with is_same_v
Browse files Browse the repository at this point in the history
For intel icpc compilers use inline constexpr rather than static constexpr for is_same_v specialization introduced in trilinos#13392
This is to workaround intel ICE issues that should not be related to the change but occur when building Trilinos with or without Kokkos' develop branch

Error output sample:
```
/home/ndellin/trilinos/Trilinos/packages/sacado/test/UnitTests/ConditionalReturnTypeTest.cpp(48): internal error: assertion failed at: "il.c", line 10434 in trans_unit_for_source_corresp
```
  • Loading branch information
ndellingwood committed Aug 29, 2024
1 parent bc52220 commit 27c0277
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/sacado/src/Kokkos_LayoutContiguous.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,23 @@ namespace std {
};

template <class Layout, unsigned Stride>
#if defined(KOKKOS_COMPILER_INTEL)
inline constexpr bool is_same_v< Kokkos::LayoutContiguous<Layout,Stride>, Layout> = is_same<Kokkos::LayoutContiguous<Layout,Stride>, Layout>::value;
#else
static constexpr bool is_same_v< Kokkos::LayoutContiguous<Layout,Stride>, Layout> = is_same<Kokkos::LayoutContiguous<Layout,Stride>, Layout>::value;
#endif

template <class Layout, unsigned Stride>
struct is_same< Layout, Kokkos::LayoutContiguous<Layout,Stride> > {
static const bool value = true;
};

template <class Layout, unsigned Stride>
#if defined(KOKKOS_COMPILER_INTEL)
inline constexpr bool is_same_v< Layout, Kokkos::LayoutContiguous<Layout,Stride>> = is_same<Kokkos::LayoutContiguous<Layout,Stride>, Layout>::value;
#else
static constexpr bool is_same_v< Layout, Kokkos::LayoutContiguous<Layout,Stride>> = is_same<Kokkos::LayoutContiguous<Layout,Stride>, Layout>::value;
#endif
}

#if KOKKOS_VERSION >= 40499
Expand Down

0 comments on commit 27c0277

Please sign in to comment.