Skip to content

Commit

Permalink
Workaround MSVC issue in tupleToArray (#4000)
Browse files Browse the repository at this point in the history
## Summary

MSVC couldn't compile the old version of tupleToArray if the tuple only
had one element.

## Additional background

See https://godbolt.org/z/bYqhGco99 and
Hi-PACE/hipace#1126
  • Loading branch information
AlexanderSinn authored Jul 1, 2024
1 parent 672e7bc commit 815151e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Src/Base/AMReX_Tuple.H
Original file line number Diff line number Diff line change
Expand Up @@ -472,12 +472,12 @@ auto tupleToArray (GpuTuple<T> const& tup)
return GpuArray<T,1>{amrex::get<0>(tup)};
}

//! Convert GpuTuple<T,Ts...> to GpuArray
template <typename T, typename... Ts, std::enable_if_t<Same<T,Ts...>::value, int> = 0>
//! Convert GpuTuple<T,T2,Ts...> to GpuArray
template <typename T, typename T2, typename... Ts, std::enable_if_t<Same<T,T2,Ts...>::value, int> = 0>
AMREX_GPU_HOST_DEVICE constexpr
auto tupleToArray (GpuTuple<T,Ts...> const& tup)
auto tupleToArray (GpuTuple<T,T2,Ts...> const& tup)
{
return detail::tuple_to_array_helper(tup, std::index_sequence_for<T,Ts...>{});
return detail::tuple_to_array_helper(tup, std::index_sequence_for<T,T2,Ts...>{});
}

} // namespace amrex
Expand Down

0 comments on commit 815151e

Please sign in to comment.