Skip to content

Commit 081f5ec

Browse files
lums658KiterLuc
andauthored
Tests to exercise combinations of views for external sort. (#5051)
This PR provides the file `tiledb/common/util/test/unit_view_combo.cc` that includes a set of tests of various combinations of the view classes that have been developed for external sort. In particular, we have tests to `chunk` a `chunk_view`, `var_length_view`, and `alt_var_length_view`, to `chunk` a `permutation_view` and permute a `chunk_view`, and to `chunk` a `zip_view` and `zip` a `chunk_view`. The tests effect these compositions by defining a range, taking a view of it (by calling, e.g., `chunk()`), and then calling another view adaptor. We do not intend to support composition by `operator|()` at this time. [sc-48753] --- TYPE: NO_HISTORY DESC: Tests to exercise combinations of views. --------- Co-authored-by: Luc Rancourt <[email protected]> Co-authored-by: KiterLuc <[email protected]>
1 parent fc1ff69 commit 081f5ec

File tree

5 files changed

+774
-3
lines changed

5 files changed

+774
-3
lines changed

tiledb/common/util/permutation_view.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,13 @@ class permutation_view : public std::ranges::view_interface<
143143
data_begin_, index_begin_, data_end_ - data_begin_};
144144
}
145145

146-
/** Size of the permutation view */
146+
/** Size of the permutation view. */
147147
size_t size() const {
148148
return data_end_ - data_begin_;
149149
}
150150

151-
/** Accessor */
152-
auto& operator[](size_t i) const {
151+
/** Accessor. Note use of decltype(auto). */
152+
decltype(auto) operator[](size_t i) const {
153153
// More general? return *(data_begin_ + *(index_begin_ + i));
154154
return data_begin_[index_begin_[i]];
155155
}

tiledb/common/util/test/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,8 @@ commence(unit_test block_view)
7474
)
7575
conclude(unit_test)
7676

77+
commence(unit_test view_combo)
78+
this_target_sources(
79+
unit_view_combo.cc
80+
)
81+
conclude(unit_test)

0 commit comments

Comments
 (0)