Add SubView class - #1915
Conversation
|
This PR is still a WIP! |
804abcd to
5ba920d
Compare
|
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? |
…pen interval [start, end) and added more checks for StridedSlice size
…assert to SubRegion
…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.
2442033 to
41c7c1c
Compare
| @@ -1,5 +1,5 @@ | |||
| //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// | |||
| // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC | |||
| // Copyright (c) 2016-26, Lawrence Livermore National Security, LLC | |||
There was a problem hiding this comment.
@gberg617 we changed the copyright header in all RAJA files so when we update each year we only need to touch two files rather than the whole repo. Here is what you should have on all files you add or modify:
https://github.com/llnl/RAJA/blob/develop/test/unit/view-layout/test-indexlayout.cpp#L1
rhornung67
left a comment
There was a problem hiding this comment.
See comment about copyright header.
|
@MrBurmark @adayton1 I assume that SubViews can be 0D in certain cases where the slice(s) reduce the dimension to a scalar. This leads to compiler errors on Windows (see failing CI) because camp array stores a C-style array of size 0. My thoughts are to either disallow 0D SubViews or add a specialization of camp array for a 0-sized array. My preference is the latter because std::array can be zero-sized, so this addition would make camp::array be more consistent with std::array. Any thoughts? |
Adding a camp array specialization for 0-size makes a lot of sense. |
I can't remember for sure, but I think that I disallowed the 0 size array because nvcc couldn't handle it (or maybe it was some other compiler). So just do plenty of testing. |
Summary
A few simple examples are provided below:
Here,
sv1andsv2are subviews of dimensions(2,3)and(2)respectively.Future tasks: