diff --git a/include/RAJA/util/View.hpp b/include/RAJA/util/View.hpp index 09509ab16e..2a5be3c440 100644 --- a/include/RAJA/util/View.hpp +++ b/include/RAJA/util/View.hpp @@ -280,54 +280,58 @@ RAJA_INLINE AtomicViewWrapper make_atomic_view( return RAJA::AtomicViewWrapper(view); } -struct layout_left { -}; -struct layout_right { -}; +struct layout_left +{}; + +struct layout_right +{}; -template +template struct Reshape; namespace detail { -template +template constexpr auto get_last_index(T last) { return last; } -template +template constexpr auto get_last_index(T0, T1 t1, Args... args) { return get_last_index(t1, args...); } } // namespace detail -template -struct Reshape> { - template - static auto get(T *ptr, Ts... s) +template +struct Reshape> +{ + template + static auto get(T* ptr, Ts... s) { constexpr int N = sizeof...(Ts); - std::array extent{s...}; + std::array extent {s...}; auto custom_layout = - RAJA::make_permuted_layout(extent, std::array{Is...}); + RAJA::make_permuted_layout(extent, std::array {Is...}); constexpr auto unit_stride = detail::get_last_index(Is...); - using view_t = RAJA::View>; + using view_t = + RAJA::View>; return view_t(ptr, custom_layout); } }; -template <> -struct Reshape { - template - static auto get(T *ptr, Ts... s) +template<> +struct Reshape +{ + template + static auto get(T* ptr, Ts... s) { constexpr int N = sizeof...(Ts); - using view_t = RAJA::View>; + using view_t = RAJA::View>; return view_t(ptr, s...); } @@ -336,29 +340,30 @@ struct Reshape { namespace detail { -template +template constexpr std::array make_reverse_array( std::index_sequence) { - return std::array{sizeof...(Is) - 1U - Is...}; + return std::array {sizeof...(Is) - 1U - Is...}; } } // namespace detail -template <> -struct Reshape { - template - static auto get(T *ptr, Ts... s) +template<> +struct Reshape +{ + template + static auto get(T* ptr, Ts... s) { constexpr int N = sizeof...(Ts); - std::array extent{s...}; + std::array extent {s...}; constexpr auto reverse_array = - detail::make_reverse_array(std::make_index_sequence{}); + detail::make_reverse_array(std::make_index_sequence {}); auto reverse_layout = RAJA::make_permuted_layout(extent, reverse_array); - using view_t = RAJA::View>; + using view_t = RAJA::View>; return view_t(ptr, reverse_layout); }