Skip to content

Commit

Permalink
Allow SubView to default construct inner view
Browse files Browse the repository at this point in the history
This covers a use case in the (non-public) SPEC CPU lbm.
  • Loading branch information
bernhardmgruber committed Nov 21, 2023
1 parent 139c586 commit c402750
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/llama/View.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,11 @@ namespace llama
using size_type = typename ArrayExtents::value_type;

public:
/// Creates a SubView given an offset. The parent view is default constructed.
LLAMA_FN_HOST_ACC_INLINE explicit SubView(ArrayIndex offset) : offset(offset)
{
}

/// Creates a SubView given a parent \ref View and offset.
template<typename StoredParentViewFwd>
LLAMA_FN_HOST_ACC_INLINE SubView(StoredParentViewFwd&& parentView, ArrayIndex offset)
Expand Down

0 comments on commit c402750

Please sign in to comment.