Skip to content

Commit

Permalink
reduce cpp17
Browse files Browse the repository at this point in the history
  • Loading branch information
alugowski committed Feb 7, 2024
1 parent ed54ef6 commit 5fd4bb1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tests/poolstl_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -578,23 +578,21 @@ TEST_CASE("exclusive_scan", "[alg][algorithm]") {
}
#endif

#if POOLSTL_HAVE_CXX17_LIB
TEST_CASE("reduce", "[alg][numeric]") {
for (auto num_threads : test_thread_counts) {
ttp::task_thread_pool pool(num_threads);

for (auto num_iters : test_arr_sizes) {
auto v = iota_vector(num_iters);

#if POOLSTL_HAVE_CXX17_LIB
auto seq = std::reduce(poolstl::par_if(false), v.cbegin(), v.cend());
#else
auto seq = std::reduce(poolstl::seq, v.cbegin(), v.cend());
#endif
auto par = std::reduce(poolstl::par.on(pool), v.cbegin(), v.cend());
REQUIRE(seq == par);
}
}
}
#endif

#if POOLSTL_HAVE_CXX17_LIB
TEST_CASE("transform_reduce_1", "[alg][numeric]") {
Expand Down

0 comments on commit 5fd4bb1

Please sign in to comment.