Skip to content

Commit 95506e4

Browse files
[NFC][SYCL][E2E] Split Reduction/reduction_internal.cpp (#16578)
The test is long enough to be a bottleneck for the total wall clock time when running E2E tests on a machine with enough cores (like our PVC/SPR runners in CI).
1 parent 81c2858 commit 95506e4

5 files changed

+64
-26
lines changed

sycl/test-e2e/Reduction/reduction_internal.cpp renamed to sycl/test-e2e/Reduction/reduction_internal.hpp

+5-26
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
// RUN: %{build} -o %t.out
2-
// RUN: %{run} %t.out
3-
41
#include <sycl/detail/core.hpp>
52

63
#include <sycl/reduction.hpp>
@@ -120,27 +117,9 @@ void testAllStrategies(RedStorage &Storage, RangeTy Range) {
120117
});
121118
}
122119

123-
int main() {
124-
queue q;
125-
RedStorage Storage(q);
126-
127-
auto TestRange = [&](auto Range) {
128-
testAllStrategies<true, true>(Storage, Range);
129-
testAllStrategies<true, false>(Storage, Range);
130-
testAllStrategies<false, true>(Storage, Range);
131-
testAllStrategies<false, false>(Storage, Range);
132-
};
133-
134-
TestRange(range<1>{42});
135-
TestRange(range<2>{8, 8});
136-
TestRange(range<3>{7, 7, 5});
137-
TestRange(nd_range<1>{range<1>{7}, range<1>{7}});
138-
TestRange(nd_range<1>{range<1>{3 * 3}, range<1>{3}});
139-
140-
// TODO: Strategies historically adopted from sycl::range implementation only
141-
// support 1-Dim case.
142-
//
143-
// TestRange(nd_range<2>{range<2>{7, 3}, range<2> {7, 3}});
144-
// TestRange(nd_range<2>{range<2>{14, 9}, range<2> {7, 3}});
145-
return 0;
120+
template <typename RangeTy> void testRange(RedStorage &Storage, RangeTy Range) {
121+
testAllStrategies<true, true>(Storage, Range);
122+
testAllStrategies<true, false>(Storage, Range);
123+
testAllStrategies<false, true>(Storage, Range);
124+
testAllStrategies<false, false>(Storage, Range);
146125
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// RUN: %{build} -o %t.out
2+
// RUN: %{run} %t.out
3+
4+
#include "reduction_internal.hpp"
5+
6+
int main() {
7+
queue q;
8+
RedStorage Storage(q);
9+
10+
testRange(Storage, nd_range<1>{range<1>{7}, range<1>{7}});
11+
testRange(Storage, nd_range<1>{range<1>{3 * 3}, range<1>{3}});
12+
13+
// TODO: Strategies historically adopted from sycl::range implementation only
14+
// support 1-Dim case.
15+
//
16+
// testRange(Storage, nd_range<2>{range<2>{7, 3}, range<2> {7, 3}});
17+
// testRange(Storage, nd_range<2>{range<2>{14, 9}, range<2> {7, 3}});
18+
19+
return 0;
20+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// RUN: %{build} -o %t.out
2+
// RUN: %{run} %t.out
3+
4+
#include "reduction_internal.hpp"
5+
6+
int main() {
7+
queue q;
8+
RedStorage Storage(q);
9+
10+
testRange(Storage, range<1>{42});
11+
12+
return 0;
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// RUN: %{build} -o %t.out
2+
// RUN: %{run} %t.out
3+
4+
#include "reduction_internal.hpp"
5+
6+
int main() {
7+
queue q;
8+
RedStorage Storage(q);
9+
10+
testRange(Storage, range<2>{8, 8});
11+
12+
return 0;
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// RUN: %{build} -o %t.out
2+
// RUN: %{run} %t.out
3+
4+
#include "reduction_internal.hpp"
5+
6+
int main() {
7+
queue q;
8+
RedStorage Storage(q);
9+
10+
testRange(Storage, range<3>{7, 7, 5});
11+
12+
return 0;
13+
}

0 commit comments

Comments
 (0)