Skip to content

Commit

Permalink
add alias for view type
Browse files Browse the repository at this point in the history
  • Loading branch information
artv3 committed Dec 23, 2024
1 parent e105bae commit 78d32b3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions include/RAJA/util/View.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,9 @@ struct Reshape<layout_right>
static auto get(T *ptr, Ts... s)
{
constexpr int N = sizeof...(Ts);
return RAJA::View<T, RAJA::Layout<N, RAJA::Index_type, N-1>>(ptr, s...);
using view_t = RAJA::View<T, RAJA::Layout<N, RAJA::Index_type, N-1>>;

return view_t(ptr, s...);
}
};

Expand All @@ -327,8 +329,8 @@ struct Reshape<layout_left>
///Should be a away to do this at compile time...
std::array<RAJA::idx_t, N> reverse_indices_array;
for(int i = N-1, j=0; i>-1; --i, j++) {reverse_indices_array[j] = i; }
auto reverse_layout = RAJA::make_permuted_layout(extent, reverse_indices_array);

auto reverse_layout = RAJA::make_permuted_layout(extent, reverse_indices_array);

return RAJA::View<T, RAJA::Layout<N, RAJA::Index_type, 0>>(ptr, reverse_layout);
}
Expand Down

0 comments on commit 78d32b3

Please sign in to comment.