Fixed the transform_reduce tests
MODIFY
test/test_transform_reduce.cpp
test/test_transform_reduce.cpp
@@ -93,10 +93,11 @@ TYPED_TEST_CASE(TransformReduceIntegerTests, TransformReduceIntegerTestsParams);
#if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_HCC
-/*template<typename InputIterator,
+template<typename InputIterator,
typename UnaryFunction,
typename OutputType,
typename BinaryFunction>
+__host__ __device__
OutputType transform_reduce(my_system &system,
InputIterator,
InputIterator,
@@ -127,6 +128,7 @@ template<typename InputIterator,
typename UnaryFunction,
typename OutputType,
typename BinaryFunction>
+__host__ __device__
OutputType transform_reduce(my_tag,
InputIterator first,
InputIterator,
@@ -149,7 +151,7 @@ TEST(TransformReduceTests, TestTransformReduceDispatchImplicit)
0);
ASSERT_EQ(13, vec.front());
-}*/
+}
TYPED_TEST(TransformReduceTests, TestTransformReduceSimple)
{

MODIFY
testing/CMakeLists.txt
testing/CMakeLists.txt
@@ -164,7 +164,7 @@ add_thrust_test("tabulate")
add_thrust_test("transform")
# add_thrust_test("transform_iterator")
# add_thrust_test("transform_output_iterator")
-# add_thrust_test("transform_reduce")
+add_thrust_test("transform_reduce")
# add_thrust_test("transform_scan")
# add_thrust_test("trivial_sequence")
# add_thrust_test("tuple")

MODIFY
testing/transform_reduce.cu
testing/transform_reduce.cu
@@ -10,6 +10,7 @@ template<typename InputIterator,
typename UnaryFunction,
typename OutputType,
typename BinaryFunction>
+__host__ __device__
OutputType transform_reduce(my_system &system,
InputIterator,
InputIterator,
@@ -31,7 +32,7 @@ void TestTransformReduceDispatchExplicit()
vec.begin(),
0,
0,
- 0);
+ thrust::plus<int>());
ASSERT_EQUAL(true, sys.is_valid());
}
@@ -41,6 +42,7 @@ template<typename InputIterator,
typename UnaryFunction,
typename OutputType,
typename BinaryFunction>
+__host__ __device__
OutputType transform_reduce(my_tag,
InputIterator first,
InputIterator,
@@ -60,7 +62,7 @@ void TestTransformReduceDispatchImplicit()
thrust::retag<my_tag>(vec.begin()),
0,
0,
- 0);
+ thrust::plus<int>());
ASSERT_EQUAL(13, vec.front());
}
@@ -125,4 +127,3 @@ void TestTransformReduceCountingIterator(void)
ASSERT_EQUAL(result, -6);
}
DECLARE_VECTOR_UNITTEST(TestTransformReduceCountingIterator);
-

Fixed the transform_reduce tests