From 2742c1607341642bddd60567ea37a980e2abf7d4 Mon Sep 17 00:00:00 2001 From: Denis Demidov Date: Mon, 14 Apr 2014 16:02:44 +0400 Subject: [PATCH] Revert changes to reduce_by_key test It won't compile in Debug mode on VS2010, but it works fine in Release mode. --- tests/reduce_by_key.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/reduce_by_key.cpp b/tests/reduce_by_key.cpp index 797dd6bf8..7288d278a 100644 --- a/tests/reduce_by_key.cpp +++ b/tests/reduce_by_key.cpp @@ -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 + bool operator()(size_t i, Tuple t) const { + return std::make_tuple(k1[i], k2[i]) < t; + } + + template + bool operator()(Tuple t, size_t i) const { + return t < std::make_tuple(k1[i], k2[i]); } }; @@ -117,9 +123,9 @@ BOOST_AUTO_TEST_CASE(rbk_tuple) std::vector 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),