Skip to content

Commit

Permalink
fix: to_array should not modify std::array
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuuichi Asahi committed Oct 12, 2024
1 parent 6560a8f commit fb2131f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions common/src/KokkosFFT_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ Layout create_layout(const std::array<int, N>& extents) {

template <class T, size_t N, size_t... Is>
constexpr Kokkos::Array<T, N> to_array_lvalue_helper(
std::array<T, N>& a, std::index_sequence<Is...>) {
const std::array<T, N>& a, std::index_sequence<Is...>) {
return {{a[Is]...}};
}
template <class T, size_t N, size_t... Is>
Expand All @@ -227,7 +227,7 @@ constexpr Kokkos::Array<T, N> to_array_rvalue_helper(
}

template <class T, size_t N, size_t... Is>
constexpr Kokkos::Array<T, N> to_array(std::array<T, N>& a) {
constexpr Kokkos::Array<T, N> to_array(const std::array<T, N>& a) {
return to_array_lvalue_helper(a, std::make_index_sequence<N>());
}
template <class T, size_t N, size_t... Is>
Expand Down

0 comments on commit fb2131f

Please sign in to comment.