Enable tests which are using reduce
MODIFY
test/test_scatter.cpp
test/test_scatter.cpp
@@ -371,8 +371,7 @@ TYPED_TEST(ScatterTests, TestScatterIfToDiscardIterator)
}
}
-// TODO: Implement reduce in system
-/*TYPED_TEST(ScatterTests, TestScatterCountingIterator)
+TYPED_TEST(ScatterTests, TestScatterCountingIterator)
{
using Vector = typename TestFixture::input_type;
@@ -449,6 +448,6 @@ TYPED_TEST(ScatterTests, TestScatterIfCountingIterator)
output.begin());
ASSERT_EQ(output, map);
-}*/
+}
#endif // THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_HCC

MODIFY
test/test_tabulate.cpp
test/test_tabulate.cpp
@@ -155,7 +155,7 @@ TYPED_TEST(TabulateTests, TestTabulate)
using T = typename Vector::value_type;
using namespace thrust::placeholders;
- for (auto size : get_sizes())
+ for (auto size : get_sizes_smaller())
{
SCOPED_TRACE(testing::Message() << "with size = " << size);
@@ -179,7 +179,7 @@ TYPED_TEST(TabulateTests, TestTabulate)
TEST(TabulateTests, TestTabulateToDiscardIterator)
{
- for (auto size : get_sizes())
+ for (auto size : get_sizes_smaller())
{
thrust::tabulate(thrust::discard_iterator<thrust::device_system_tag>(),
thrust::discard_iterator<thrust::device_system_tag>(size),

MODIFY
test/test_utils.hpp
test/test_utils.hpp
@@ -38,6 +38,15 @@ std::vector<size_t> get_sizes()
return sizes;
}
+std::vector<size_t> get_sizes_smaller()
+{
+ std::vector<size_t> sizes = {
+ 0, 1, 2, 12, 63, 64, 211, 256, 344,
+ 1024, 2048, 5096, 34567
+ };
+ return sizes;
+}
+
template<class T>
inline auto get_random_data(size_t size, T min, T max)
-> typename std::enable_if<rocprim::is_integral<T>::value, thrust::host_vector<T>>::type

MODIFY
test/test_vector.cpp
test/test_vector.cpp
@@ -173,8 +173,7 @@ TYPED_TEST(VectorTests, TestVectorElementAssignment)
w[1] = v[1];
w[2] = v[2];
- // TODO: Implement reduce in system
- //ASSERT_EQ(v, w);
+ ASSERT_EQ(v, w);
}
TYPED_TEST(VectorTests, TestVectorFromSTLVector)
@@ -323,8 +322,7 @@ TYPED_TEST(VectorTests, TestVectorToAndFromHostVector)
ASSERT_EQ(v, h);
}
-// TODO: Implement reduce in system
-/*TYPED_TEST(VectorTests, TestVectorAssignFromDeviceVector)
+TYPED_TEST(VectorTests, TestVectorAssignFromDeviceVector)
{
using Vector = typename TestFixture::input_type;
using T = typename Vector::value_type;
@@ -340,7 +338,6 @@ TYPED_TEST(VectorTests, TestVectorToAndFromHostVector)
ASSERT_EQ(v, d);
}
-// TODO: Implement reduce in system
TYPED_TEST(VectorTests, TestVectorToAndFromDeviceVector)
{
using Vector = typename TestFixture::input_type;
@@ -372,7 +369,7 @@ TYPED_TEST(VectorTests, TestVectorToAndFromDeviceVector)
v = h;
ASSERT_EQ(v, h);
-}*/
+}
TYPED_TEST(VectorTests, TestVectorWithInitialValue)
{
@@ -504,35 +501,34 @@ TYPED_TEST(VectorTests, TestVectorEquality)
s_b[0] = T(0); s_b[1] = T(1); s_b[2] = T(3);
s_b[0] = T(0); s_b[1] = T(1);
- // TODO: Implement reduce in system
- ASSERT_EQ((h_a == h_a), true); //ASSERT_EQ((h_a == d_a), true); ASSERT_EQ((d_a == h_a), true); ASSERT_EQ((d_a == d_a), true);
- ASSERT_EQ((h_b == h_b), true); //ASSERT_EQ((h_b == d_b), true); ASSERT_EQ((d_b == h_b), true); ASSERT_EQ((d_b == d_b), true);
- ASSERT_EQ((h_c == h_c), true); //ASSERT_EQ((h_c == d_c), true); ASSERT_EQ((d_c == h_c), true); ASSERT_EQ((d_c == d_c), true);
+ ASSERT_EQ((h_a == h_a), true); ASSERT_EQ((h_a == d_a), true); ASSERT_EQ((d_a == h_a), true); ASSERT_EQ((d_a == d_a), true);
+ ASSERT_EQ((h_b == h_b), true); ASSERT_EQ((h_b == d_b), true); ASSERT_EQ((d_b == h_b), true); ASSERT_EQ((d_b == d_b), true);
+ ASSERT_EQ((h_c == h_c), true); ASSERT_EQ((h_c == d_c), true); ASSERT_EQ((d_c == h_c), true); ASSERT_EQ((d_c == d_c), true);
// test vector vs device_vector
- //ASSERT_EQ((s_a == d_a), true); ASSERT_EQ((d_a == s_a), true);
- //ASSERT_EQ((s_b == d_b), true); ASSERT_EQ((d_b == s_b), true);
- //ASSERT_EQ((s_c == d_c), true); ASSERT_EQ((d_c == s_c), true);
+ ASSERT_EQ((s_a == d_a), true); ASSERT_EQ((d_a == s_a), true);
+ ASSERT_EQ((s_b == d_b), true); ASSERT_EQ((d_b == s_b), true);
+ ASSERT_EQ((s_c == d_c), true); ASSERT_EQ((d_c == s_c), true);
// test vector vs host_vector
ASSERT_EQ((s_a == h_a), true); ASSERT_EQ((h_a == s_a), true);
ASSERT_EQ((s_b == h_b), true); ASSERT_EQ((h_b == s_b), true);
ASSERT_EQ((s_c == h_c), true); ASSERT_EQ((h_c == s_c), true);
- ASSERT_EQ((h_a == h_b), false); /*ASSERT_EQ((h_a == d_b), false); ASSERT_EQ((d_a == h_b), false); ASSERT_EQ((d_a == d_b), false);*/
- ASSERT_EQ((h_b == h_a), false); /*ASSERT_EQ((h_b == d_a), false); ASSERT_EQ((d_b == h_a), false); ASSERT_EQ((d_b == d_a), false);*/
- ASSERT_EQ((h_a == h_c), false); /*ASSERT_EQ((h_a == d_c), false); ASSERT_EQ((d_a == h_c), false); ASSERT_EQ((d_a == d_c), false);*/
- ASSERT_EQ((h_c == h_a), false); /*ASSERT_EQ((h_c == d_a), false); ASSERT_EQ((d_c == h_a), false); ASSERT_EQ((d_c == d_a), false);*/
- ASSERT_EQ((h_b == h_c), false); /*ASSERT_EQ((h_b == d_c), false); ASSERT_EQ((d_b == h_c), false); ASSERT_EQ((d_b == d_c), false);*/
- ASSERT_EQ((h_c == h_b), false); /*ASSERT_EQ((h_c == d_b), false); ASSERT_EQ((d_c == h_b), false); ASSERT_EQ((d_c == d_b), false);*/
+ ASSERT_EQ((h_a == h_b), false); ASSERT_EQ((h_a == d_b), false); ASSERT_EQ((d_a == h_b), false); ASSERT_EQ((d_a == d_b), false);
+ ASSERT_EQ((h_b == h_a), false); ASSERT_EQ((h_b == d_a), false); ASSERT_EQ((d_b == h_a), false); ASSERT_EQ((d_b == d_a), false);
+ ASSERT_EQ((h_a == h_c), false); ASSERT_EQ((h_a == d_c), false); ASSERT_EQ((d_a == h_c), false); ASSERT_EQ((d_a == d_c), false);
+ ASSERT_EQ((h_c == h_a), false); ASSERT_EQ((h_c == d_a), false); ASSERT_EQ((d_c == h_a), false); ASSERT_EQ((d_c == d_a), false);
+ ASSERT_EQ((h_b == h_c), false); ASSERT_EQ((h_b == d_c), false); ASSERT_EQ((d_b == h_c), false); ASSERT_EQ((d_b == d_c), false);
+ ASSERT_EQ((h_c == h_b), false); ASSERT_EQ((h_c == d_b), false); ASSERT_EQ((d_c == h_b), false); ASSERT_EQ((d_c == d_b), false);
// test vector vs device_vector
- //ASSERT_EQ((s_a == d_b), false); ASSERT_EQ((d_a == s_b), false);
- //ASSERT_EQ((s_b == d_a), false); ASSERT_EQ((d_b == s_a), false);
- //ASSERT_EQ((s_a == d_c), false); ASSERT_EQ((d_a == s_c), false);
- //ASSERT_EQ((s_c == d_a), false); ASSERT_EQ((d_c == s_a), false);
- //ASSERT_EQ((s_b == d_c), false); ASSERT_EQ((d_b == s_c), false);
- //ASSERT_EQ((s_c == d_b), false); ASSERT_EQ((d_c == s_b), false);
+ ASSERT_EQ((s_a == d_b), false); ASSERT_EQ((d_a == s_b), false);
+ ASSERT_EQ((s_b == d_a), false); ASSERT_EQ((d_b == s_a), false);
+ ASSERT_EQ((s_a == d_c), false); ASSERT_EQ((d_a == s_c), false);
+ ASSERT_EQ((s_c == d_a), false); ASSERT_EQ((d_c == s_a), false);
+ ASSERT_EQ((s_b == d_c), false); ASSERT_EQ((d_b == s_c), false);
+ ASSERT_EQ((s_c == d_b), false); ASSERT_EQ((d_c == s_b), false);
// test vector vs host_vector
ASSERT_EQ((s_a == h_b), false); ASSERT_EQ((h_a == s_b), false);
@@ -569,35 +565,34 @@ TYPED_TEST(VectorTests, TestVectorInequality)
s_b[0] = T(0); s_b[1] = T(1); s_b[2] = T(3);
s_b[0] = T(0); s_b[1] = T(1);
- // TODO: Implement reduce in system
- ASSERT_EQ((h_a != h_a), false); //ASSERT_EQ((h_a != d_a), false); ASSERT_EQ((d_a != h_a), false); ASSERT_EQ((d_a != d_a), false);
- ASSERT_EQ((h_b != h_b), false); //ASSERT_EQ((h_b != d_b), false); ASSERT_EQ((d_b != h_b), false); ASSERT_EQ((d_b != d_b), false);
- ASSERT_EQ((h_c != h_c), false); //ASSERT_EQ((h_c != d_c), false); ASSERT_EQ((d_c != h_c), false); ASSERT_EQ((d_c != d_c), false);
+ ASSERT_EQ((h_a != h_a), false); ASSERT_EQ((h_a != d_a), false); ASSERT_EQ((d_a != h_a), false); ASSERT_EQ((d_a != d_a), false);
+ ASSERT_EQ((h_b != h_b), false); ASSERT_EQ((h_b != d_b), false); ASSERT_EQ((d_b != h_b), false); ASSERT_EQ((d_b != d_b), false);
+ ASSERT_EQ((h_c != h_c), false); ASSERT_EQ((h_c != d_c), false); ASSERT_EQ((d_c != h_c), false); ASSERT_EQ((d_c != d_c), false);
// test vector vs device_vector
- //ASSERT_EQ((s_a != d_a), false); ASSERT_EQ((d_a != s_a), false);
- //ASSERT_EQ((s_b != d_b), false); ASSERT_EQ((d_b != s_b), false);
- //ASSERT_EQ((s_c != d_c), false); ASSERT_EQ((d_c != s_c), false);
+ ASSERT_EQ((s_a != d_a), false); ASSERT_EQ((d_a != s_a), false);
+ ASSERT_EQ((s_b != d_b), false); ASSERT_EQ((d_b != s_b), false);
+ ASSERT_EQ((s_c != d_c), false); ASSERT_EQ((d_c != s_c), false);
// test vector vs host_vector
ASSERT_EQ((s_a != h_a), false); ASSERT_EQ((h_a != s_a), false);
ASSERT_EQ((s_b != h_b), false); ASSERT_EQ((h_b != s_b), false);
ASSERT_EQ((s_c != h_c), false); ASSERT_EQ((h_c != s_c), false);
- ASSERT_EQ((h_a != h_b), true); //ASSERT_EQ((h_a != d_b), true); ASSERT_EQ((d_a != h_b), true); ASSERT_EQ((d_a != d_b), true);
- ASSERT_EQ((h_b != h_a), true); //ASSERT_EQ((h_b != d_a), true); ASSERT_EQ((d_b != h_a), true); ASSERT_EQ((d_b != d_a), true);
- ASSERT_EQ((h_a != h_c), true); //ASSERT_EQ((h_a != d_c), true); ASSERT_EQ((d_a != h_c), true); ASSERT_EQ((d_a != d_c), true);
- ASSERT_EQ((h_c != h_a), true); //ASSERT_EQ((h_c != d_a), true); ASSERT_EQ((d_c != h_a), true); ASSERT_EQ((d_c != d_a), true);
- ASSERT_EQ((h_b != h_c), true); //ASSERT_EQ((h_b != d_c), true); ASSERT_EQ((d_b != h_c), true); ASSERT_EQ((d_b != d_c), true);
- ASSERT_EQ((h_c != h_b), true); //ASSERT_EQ((h_c != d_b), true); ASSERT_EQ((d_c != h_b), true); ASSERT_EQ((d_c != d_b), true);
+ ASSERT_EQ((h_a != h_b), true); ASSERT_EQ((h_a != d_b), true); ASSERT_EQ((d_a != h_b), true); ASSERT_EQ((d_a != d_b), true);
+ ASSERT_EQ((h_b != h_a), true); ASSERT_EQ((h_b != d_a), true); ASSERT_EQ((d_b != h_a), true); ASSERT_EQ((d_b != d_a), true);
+ ASSERT_EQ((h_a != h_c), true); ASSERT_EQ((h_a != d_c), true); ASSERT_EQ((d_a != h_c), true); ASSERT_EQ((d_a != d_c), true);
+ ASSERT_EQ((h_c != h_a), true); ASSERT_EQ((h_c != d_a), true); ASSERT_EQ((d_c != h_a), true); ASSERT_EQ((d_c != d_a), true);
+ ASSERT_EQ((h_b != h_c), true); ASSERT_EQ((h_b != d_c), true); ASSERT_EQ((d_b != h_c), true); ASSERT_EQ((d_b != d_c), true);
+ ASSERT_EQ((h_c != h_b), true); ASSERT_EQ((h_c != d_b), true); ASSERT_EQ((d_c != h_b), true); ASSERT_EQ((d_c != d_b), true);
// test vector vs device_vector
- //ASSERT_EQ((s_a != d_b), true); ASSERT_EQ((d_a != s_b), true);
- //ASSERT_EQ((s_b != d_a), true); ASSERT_EQ((d_b != s_a), true);
- //ASSERT_EQ((s_a != d_c), true); ASSERT_EQ((d_a != s_c), true);
- //ASSERT_EQ((s_c != d_a), true); ASSERT_EQ((d_c != s_a), true);
- //ASSERT_EQ((s_b != d_c), true); ASSERT_EQ((d_b != s_c), true);
- //ASSERT_EQ((s_c != d_b), true); ASSERT_EQ((d_c != s_b), true);
+ ASSERT_EQ((s_a != d_b), true); ASSERT_EQ((d_a != s_b), true);
+ ASSERT_EQ((s_b != d_a), true); ASSERT_EQ((d_b != s_a), true);
+ ASSERT_EQ((s_a != d_c), true); ASSERT_EQ((d_a != s_c), true);
+ ASSERT_EQ((s_c != d_a), true); ASSERT_EQ((d_c != s_a), true);
+ ASSERT_EQ((s_b != d_c), true); ASSERT_EQ((d_b != s_c), true);
+ ASSERT_EQ((s_c != d_b), true); ASSERT_EQ((d_c != s_b), true);
// test vector vs host_vector
ASSERT_EQ((s_a != h_b), true); ASSERT_EQ((h_a != s_b), true);
@@ -686,9 +681,7 @@ TYPED_TEST(VectorTests, TestVectorShrinkToFit)
ASSERT_EQ( 3, v.capacity());
}
-// TODO: Implement reduce in system
-/*
-template <int N>
+/*template <int N>
struct LargeStruct
{
int data[N];
@@ -706,7 +699,7 @@ struct LargeStruct
TEST(VectorTests, TestVectorContainingLargeType)
{
const static int N = 100;
- using T = LargeStruct<N> T;
+ using T = LargeStruct<N>;
thrust::device_vector<T> dv1;
thrust::host_vector<T> hv1;

MODIFY
test/test_vector_manipulation.cpp
test/test_vector_manipulation.cpp
@@ -115,10 +115,10 @@ TYPED_TEST(VectorManipulationTests, TestVectorManipulation)
Vector cpy0 = src;
Vector cpy1(stl_vector);
Vector cpy2(stl_vector.begin(), stl_vector.end());
- // TODO: Implement reduce in system
- //ASSERT_EQ(cpy0, src);
- //ASSERT_EQ(cpy1, src);
- //ASSERT_EQ(cpy2, src);
+
+ ASSERT_EQ(cpy0, src);
+ ASSERT_EQ(cpy1, src);
+ ASSERT_EQ(cpy2, src);
// resizing
Vector vec1(src);
@@ -126,7 +126,7 @@ TYPED_TEST(VectorManipulationTests, TestVectorManipulation)
ASSERT_EQ(vec1.size(), size + 3);
vec1.resize(size);
ASSERT_EQ(vec1.size(), size);
- //ASSERT_EQ(vec1, src); // TODO: Implement reduce in system
+ ASSERT_EQ(vec1, src);
vec1.resize(size + 20, T(11));
Vector tail(vec1.begin() + size, vec1.end());

Enable tests which are using reduce