Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions tests/group_functions/group_of.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ void joint_of_group(sycl::queue& queue) {

sycl::range<D> work_group_range = sycl_cts::util::work_group_range<D>(queue);
size_t work_group_size = work_group_range.size();
// Note that the predicates 'one_true' and 'some_true' are in fact 'all_true'
// if the input vector, v, has a size of 1. Since one of the test cases uses
// size = (work_group_size / 2), we need to make sure that work_group_size is
// greater than 2.
assert(work_group_size > 2 &&
"Not all test checks hold when the work-group size is not greater "
"than 2");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But what about the ones where the checks hold?
Are there some interesting cases where it checks for something not tested otherwise? 🤔

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But what about the ones where the checks hold? Are there some interesting cases where it checks for something not tested otherwise? 🤔

This test has four predicates:

              auto none_true = [&](T i) { return i == 0; };
              auto one_true = [&](T i) { return i == 1; };
              auto some_true = [&](T i) { return i > size / 2; };
              auto all_true = [&](T i) { return i <= size; };

The predicates for one_true and some_true do not work if the input has exactly one element. This is also the motivation for the existing assertions on line 199 and line 402.

The other two predicates form valid tests even when the workgroup size is 1. I just don't think it's worth running only those tests for that input size since the larger workgroup will also test with the same predicates.


const size_t sizes[3] = {5, work_group_size / 2, 3 * work_group_size};
for (size_t size : sizes) {
Expand Down
Loading