Skip to content

Commit

Permalink
Revert changes to reduce_by_key test
Browse files Browse the repository at this point in the history
It won't compile in Debug mode on VS2010, but it works fine in Release
mode.
  • Loading branch information
ddemidov committed Apr 14, 2014
1 parent 206e69b commit 2742c16
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions tests/reduce_by_key.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,14 @@ struct comp {

comp(const cl_int * k1, const cl_long *k2) : k1(k1), k2(k2) {}

bool operator()(size_t i, size_t j) const {
return std::make_tuple(k1[i], k2[i]) < std::make_tuple(k1[j], k2[j]);
template <class Tuple>
bool operator()(size_t i, Tuple t) const {
return std::make_tuple(k1[i], k2[i]) < t;
}

template <class Tuple>
bool operator()(Tuple t, size_t i) const {
return t < std::make_tuple(k1[i], k2[i]);
}
};

Expand Down Expand Up @@ -117,9 +123,9 @@ BOOST_AUTO_TEST_CASE(rbk_tuple)
std::vector<size_t> idx(n);
std::iota(idx.begin(), idx.end(), 0);

check_sample(okey1, okey2, ovals, [&](size_t i, cl_int, cl_long, double dev_sum) {
check_sample(okey1, okey2, ovals, [&](size_t, cl_int key1, cl_long key2, double dev_sum) {
auto r = std::equal_range(idx.begin(), idx.end(),
i, comp(k1.data(), k2.data()));
std::make_tuple(key1, key2), comp(k1.data(), k2.data()));

double host_sum = std::accumulate(
ivals.begin() + std::distance(idx.begin(), r.first),
Expand Down

0 comments on commit 2742c16

Please sign in to comment.