Skip to content

Commit

Permalink
More inclusive_scan test fixes
Browse files Browse the repository at this point in the history
- flyby: fixing typo in CMakeLists.txt
  • Loading branch information
hkaiser committed Jul 2, 2017
1 parent ebfa638 commit 12e7720
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Expand Up @@ -912,7 +912,7 @@ endif()

# HPX_WITH_INCLUSIVE_SCAN_COMPATIBILITY: introduced in V1.1.0
hpx_option(HPX_WITH_INCLUSIVE_SCAN_COMPATIBILITY BOOL
"Enable old overloads for inclkusive_scan (default: ON)"
"Enable old overloads for inclusive_scan (default: ON)"
ON ADVANCED)
if(HPX_WITH_INCLUSIVE_SCAN_COMPATIBILITY)
hpx_add_config_define(HPX_HAVE_INCLUSIVE_SCAN_COMPATIBILITY)
Expand Down
4 changes: 2 additions & 2 deletions hpx/parallel/algorithms/reduce_by_key.hpp
Expand Up @@ -358,7 +358,7 @@ namespace hpx { namespace parallel { inline namespace v1
typedef hpx::util::tuple<value_type, reduce_key_series_states>
lambda_type;
hpx::parallel::inclusive_scan(sync_policy, states_begin,
states_end, states_out_begin, initial,
states_end, states_out_begin,
// B is the current entry, A is the one passed in from 'previous'
[&func](zip_type_in a, zip_type_in b)->lambda_type
{
Expand Down Expand Up @@ -387,7 +387,7 @@ namespace hpx { namespace parallel { inline namespace v1
reduce_key_series_states(
a_state.start || b_state.start, b_state.end));
}
});
}, initial);

// now copy the values and keys for each element that
// is marked by an 'END' state to the final output
Expand Down
24 changes: 12 additions & 12 deletions tests/regressions/parallel/scan_different_inits.cpp
Expand Up @@ -25,11 +25,11 @@ void test_zero()
std::vector<int> b, c, d, e, f, g;

Iter i_inc_add =
inclusive_scan(execution::par, a.begin(), a.end(), b.begin(), 100,
[](int bar, int baz){ return bar+baz; });
inclusive_scan(execution::par, a.begin(), a.end(), b.begin(),
[](int bar, int baz){ return bar+baz; }, 100);
Iter i_inc_mult =
inclusive_scan(execution::par, a.begin(), a.end(), c.begin(), 10,
[](int bar, int baz){ return bar*baz; });
inclusive_scan(execution::par, a.begin(), a.end(), c.begin(),
[](int bar, int baz){ return bar*baz; }, 10);
Iter i_exc_add =
exclusive_scan(execution::par, a.begin(), a.end(), d.begin(), 100,
[](int bar, int baz){ return bar+baz; });
Expand Down Expand Up @@ -64,12 +64,12 @@ void test_async_zero()

Fut_Iter f_inc_add =
inclusive_scan(execution::par(execution::task),
a.begin(), a.end(), b.begin(), 100,
[](int bar, int baz){ return bar+baz; });
a.begin(), a.end(), b.begin(),
[](int bar, int baz){ return bar+baz; }, 100);
Fut_Iter f_inc_mult =
inclusive_scan(execution::par(execution::task),
a.begin(), a.end(), c.begin(), 10,
[](int bar, int baz){ return bar*baz; });
a.begin(), a.end(), c.begin(),
[](int bar, int baz){ return bar*baz; }, 10);
Fut_Iter f_exc_add =
exclusive_scan(execution::par(execution::task),
a.begin(), a.end(), d.begin(), 100,
Expand Down Expand Up @@ -114,9 +114,9 @@ void test_one(std::vector<int> a)
auto fun_conv = [](int foo){ return foo - 3; };

Iter f_inc_add =
inclusive_scan(execution::par, a.begin(), a.end(), b.begin(), 10, fun_add);
inclusive_scan(execution::par, a.begin(), a.end(), b.begin(), fun_add, 10);
Iter f_inc_mult =
inclusive_scan(execution::par, a.begin(), a.end(), c.begin(), 10, fun_mult);
inclusive_scan(execution::par, a.begin(), a.end(), c.begin(), fun_mult, 10);
Iter f_exc_add =
exclusive_scan(execution::par, a.begin(), a.end(), d.begin(), 10, fun_add);
Iter f_exc_mult =
Expand Down Expand Up @@ -173,10 +173,10 @@ void test_async_one(std::vector<int> a)

Fut_Iter f_inc_add =
inclusive_scan(execution::par(execution::task),
a.begin(), a.end(), b.begin(), 10, fun_add);
a.begin(), a.end(), b.begin(), fun_add, 10);
Fut_Iter f_inc_mult =
inclusive_scan(execution::par(execution::task),
a.begin(), a.end(), c.begin(), 10, fun_mult);
a.begin(), a.end(), c.begin(), fun_mult, 10);
Fut_Iter f_exc_add =
exclusive_scan(execution::par(execution::task),
a.begin(), a.end(), d.begin(), 10, fun_add);
Expand Down
12 changes: 6 additions & 6 deletions tests/unit/component/partitioned_vector_inclusive_scan.cpp
Expand Up @@ -61,7 +61,7 @@ void inclusive_scan_algo_tests_with_policy(
t1.restart();

hpx::parallel::inclusive_scan(policy,
in.begin(), in.end(), out.begin(), val, opt<T>());
in.begin(), in.end(), out.begin(), opt<T>(), val);

double e2 = t1.elapsed();
t1.restart();
Expand Down Expand Up @@ -91,7 +91,7 @@ void inclusive_scan_algo_tests_segmented_out_with_policy(
t1.restart();

hpx::parallel::inclusive_scan(policy,
in.begin(), in.end(), out.begin(), val, opt<T>());
in.begin(), in.end(), out.begin(), opt<T>(), val);

double e2 = t1.elapsed();
t1.restart();
Expand Down Expand Up @@ -121,7 +121,7 @@ void inclusive_scan_algo_tests_inplace_with_policy(
t1.restart();

hpx::parallel::inclusive_scan(policy,
in.begin(), in.end(), in.begin(), val, opt<T>());
in.begin(), in.end(), in.begin(), opt<T>(), val);

double e2 = t1.elapsed();
t1.restart();
Expand Down Expand Up @@ -153,7 +153,7 @@ void inclusive_scan_algo_tests_with_policy_async(

auto res =
hpx::parallel::inclusive_scan(policy,
in.begin(), in.end(), out.begin(), val, opt<T>());
in.begin(), in.end(), out.begin(), opt<T>(), val);
res.get();

double e2 = t1.elapsed();
Expand Down Expand Up @@ -185,7 +185,7 @@ void inclusive_scan_algo_tests_segmented_out_with_policy_async(

auto res =
hpx::parallel::inclusive_scan(policy,
in.begin(), in.end(), out.begin(), val, opt<T>());
in.begin(), in.end(), out.begin(), opt<T>(), val);
res.get();

double e2 = t1.elapsed();
Expand Down Expand Up @@ -217,7 +217,7 @@ void inclusive_scan_algo_tests_inplace_with_policy_async(

auto res =
hpx::parallel::inclusive_scan(policy,
in.begin(), in.end(), in.begin(), val, opt<T>());
in.begin(), in.end(), in.begin(), opt<T>(), val);
res.get();

double e2 = t1.elapsed();
Expand Down

0 comments on commit 12e7720

Please sign in to comment.