Conversation
|
This PR is still a WIP! |
include/RAJA/util/SubView.hpp
Outdated
| RAJA_INLINE RAJA_HOST_DEVICE constexpr auto array_to_tuple_impl(const camp::array<T, N>& arr, camp::idx_seq<Is...>) { | ||
| return camp::make_tuple(arr[Is]...); | ||
| } | ||
|
|
||
| template <typename T, size_t N> | ||
| RAJA_INLINE RAJA_HOST_DEVICE constexpr auto array_to_tuple(const camp::array<T, N>& arr) { | ||
| return array_to_tuple_impl(arr, camp::make_idx_seq_t<N>{}); | ||
| } |
There was a problem hiding this comment.
Do we not have this somewhere?
There was a problem hiding this comment.
If not it would be good to add it in a more general header.
There was a problem hiding this comment.
Agreed. I'll look into moving this to camp.
There was a problem hiding this comment.
This function wasn't eventually needed. That said, I can still add something like this to camp if you think it could be useful.
804abcd to
5ba920d
Compare
|
|
||
| } | ||
|
|
||
| // void test_subviewGPU() { |
There was a problem hiding this comment.
To Do: Fix GPU tests.
|
I'm considering separating the SubView holding the view from the slices that are used to access the view, somewhat analogous to the approach of having layouts and Views be separate classes. Any thoughts on this? |
1e928d3 to
efa96d5
Compare
…pen interval [start, end) and added more checks for StridedSlice size
| using NonConstView = | ||
| MultiView<nc_value_type, layout_type, P2Pidx, nc_pointer_type>; | ||
|
|
||
| static constexpr size_t n_dims = layout_type::n_dims + 1; |
There was a problem hiding this comment.
@rchen20 Does this look right for MultiViews?
…ith projected dimensions
2. Replaced camp::array usage with std::array. 3. Fixed and simplified get_dim_stride and get_parent_dim_stride. 4. Replaced usage of IndexType with size_t where appropriate.
| } | ||
|
|
||
| template<size_t DIM> | ||
| RAJA_INLINE RAJA_HOST_DEVICE constexpr auto get_parent_dim_stride() const { |
There was a problem hiding this comment.
I'm not sure how useful get_parent_dim_stride() is.
7323aa3 to
5fb6dd0
Compare
0c1e1dc to
be6df15
Compare
Summary
A few simple examples are provided below:
Here,
sv1andsv2are subviews of dimensions(2,3)and(2)respectively.