Fix CMakeLists on testing folder
MODIFY
test/test_async_copy.cpp
test/test_async_copy.cpp
@@ -61,14 +61,12 @@ void AsyncCopyHostToDevice()
for(auto size : get_sizes())
{
SCOPED_TRACE(testing::Message() << "with size = " << size);
- for(size_t seed_index = 0; seed_index < random_seeds_count + seed_size; seed_index++)
+ for(auto seed : get_seeds())
{
- unsigned int seed_value
- = seed_index < random_seeds_count ? rand() : seeds[seed_index - random_seeds_count];
- SCOPED_TRACE(testing::Message() << "with seed= " << seed_value);
+ SCOPED_TRACE(testing::Message() << "with seed= " << seed);
thrust::host_vector<T> h0 = get_random_data<T>(
- size, std::numeric_limits<T>::min(), std::numeric_limits<T>::max(), seed_value);
+ size, std::numeric_limits<T>::min(), std::numeric_limits<T>::max(), seed);
thrust::device_vector<T> d0(size);
auto f0 = AsyncCopyCallable{}(
@@ -102,14 +100,12 @@ void AsyncCopyDeviceToHost()
for(auto size : get_sizes())
{
SCOPED_TRACE(testing::Message() << "with size = " << size);
- for(size_t seed_index = 0; seed_index < random_seeds_count + seed_size; seed_index++)
+ for(auto seed : get_seeds())
{
- unsigned int seed_value
- = seed_index < random_seeds_count ? rand() : seeds[seed_index - random_seeds_count];
- SCOPED_TRACE(testing::Message() << "with seed= " << seed_value);
+ SCOPED_TRACE(testing::Message() << "with seed= " << seed);
thrust::host_vector<T> h0 = get_random_data<T>(
- size, std::numeric_limits<T>::min(), std::numeric_limits<T>::max(), seed_value);
+ size, std::numeric_limits<T>::min(), std::numeric_limits<T>::max(), seed);
thrust::device_vector<T> h1(size);
thrust::device_vector<T> d0(size);
@@ -149,14 +145,12 @@ TYPED_TEST(AsyncCopyTests, TestAsyncCopyTriviallyRelocatableDeviceToHostPolicies
for(auto size : get_sizes())
{
SCOPED_TRACE(testing::Message() << "with size = " << size);
- for(size_t seed_index = 0; seed_index < random_seeds_count + seed_size; seed_index++)
+ for(auto seed : get_seeds())
{
- unsigned int seed_value
- = seed_index < random_seeds_count ? rand() : seeds[seed_index - random_seeds_count];
- SCOPED_TRACE(testing::Message() << "with seed= " << seed_value);
+ SCOPED_TRACE(testing::Message() << "with seed= " << seed);
thrust::host_vector<T> h0_data = get_random_data<T>(
- size, std::numeric_limits<T>::min(), std::numeric_limits<T>::max(), seed_value);
+ size, std::numeric_limits<T>::min(), std::numeric_limits<T>::max(), seed);
thrust::device_vector<T> d0_data(size);
thrust::device_vector<T> d1_data(size);
@@ -182,14 +176,12 @@ TYPED_TEST(AsyncCopyTests, TestAsyncCopyDevicetoDeviceWithPolicy)
for(auto size : get_sizes())
{
SCOPED_TRACE(testing::Message() << "with size = " << size);
- for(size_t seed_index = 0; seed_index < random_seeds_count + seed_size; seed_index++)
+ for(auto seed : get_seeds())
{
- unsigned int seed_value
- = seed_index < random_seeds_count ? rand() : seeds[seed_index - random_seeds_count];
- SCOPED_TRACE(testing::Message() << "with seed= " << seed_value);
+ SCOPED_TRACE(testing::Message() << "with seed= " << seed);
thrust::host_vector<T> h0_data = get_random_data<T>(
- size, std::numeric_limits<T>::min(), std::numeric_limits<T>::max(), seed_value);
+ size, std::numeric_limits<T>::min(), std::numeric_limits<T>::max(), seed);
thrust::device_vector<T> d0_data(size);
thrust::device_vector<T> d1_data(size);

MODIFY
test/test_async_reduce.cpp
test/test_async_reduce.cpp
@@ -349,14 +349,12 @@ void testAsyncReduce()
for(auto size : get_sizes())
{
SCOPED_TRACE(testing::Message() << "with size = " << size);
- for(size_t seed_index = 0; seed_index < random_seeds_count + seed_size; seed_index++)
+ for(auto seed : get_seeds())
{
- unsigned int seed_value
- = seed_index < random_seeds_count ? rand() : seeds[seed_index - random_seeds_count];
- SCOPED_TRACE(testing::Message() << "with seed= " << seed_value);
+ SCOPED_TRACE(testing::Message() << "with seed= " << seed);
thrust::host_vector<T> h0 = get_random_data<T>(
- size, T(-1000), T(1000), seed_value);
+ size, T(-1000), T(1000), seed);
thrust::device_vector<T> d0a(h0);
thrust::device_vector<T> d0b(h0);
@@ -773,14 +771,12 @@ TYPED_TEST(AsyncReduceTests, TestAsyncReduceUsing)
for(auto size : get_sizes())
{
SCOPED_TRACE(testing::Message() << "with size = " << size);
- for(size_t seed_index = 0; seed_index < random_seeds_count + seed_size; seed_index++)
+ for(auto seed : get_seeds())
{
- unsigned int seed_value
- = seed_index < random_seeds_count ? rand() : seeds[seed_index - random_seeds_count];
- SCOPED_TRACE(testing::Message() << "with seed= " << seed_value);
+ SCOPED_TRACE(testing::Message() << "with seed= " << seed);
thrust::host_vector<T> h0 = get_random_data<T>(
- size, T(-1000), T(1000), seed_value);
+ size, T(-1000), T(1000), seed);
thrust::device_vector<T> d0a(h0);
thrust::device_vector<T> d0b(h0);
@@ -830,14 +826,12 @@ TYPED_TEST(AsyncReduceTests, TestAsyncReduceAfter)
for(auto size : get_sizes())
{
SCOPED_TRACE(testing::Message() << "with size = " << size);
- for(size_t seed_index = 0; seed_index < random_seeds_count + seed_size; seed_index++)
+ for(auto seed : get_seeds())
{
- unsigned int seed_value
- = seed_index < random_seeds_count ? rand() : seeds[seed_index - random_seeds_count];
- SCOPED_TRACE(testing::Message() << "with seed= " << seed_value);
+ SCOPED_TRACE(testing::Message() << "with seed= " << seed);
thrust::host_vector<T> h0 = get_random_data<T>(
- size, T(-1000), T(1000), seed_value);
+ size, T(-1000), T(1000), seed);
thrust::device_vector<T> d0(h0);
@@ -907,14 +901,12 @@ TYPED_TEST(AsyncReduceTests, TestAsyncReduceOnThenAfter)
for(auto size : get_sizes())
{
SCOPED_TRACE(testing::Message() << "with size = " << size);
- for(size_t seed_index = 0; seed_index < random_seeds_count + seed_size; seed_index++)
+ for(auto seed : get_seeds())
{
- unsigned int seed_value
- = seed_index < random_seeds_count ? rand() : seeds[seed_index - random_seeds_count];
- SCOPED_TRACE(testing::Message() << "with seed= " << seed_value);
+ SCOPED_TRACE(testing::Message() << "with seed= " << seed);
thrust::host_vector<T> h0 = get_random_data<T>(
- size, T(-1000), T(1000), seed_value);
+ size, T(-1000), T(1000), seed);
thrust::device_vector<T> d0(h0);
@@ -994,12 +986,12 @@ TYPED_TEST(AsyncReduceTests, TestAsyncReduceAllocatorOnThenAfter)
SCOPED_TRACE(testing::Message() << "with size = " << size);
for(size_t seed_index = 0; seed_index < random_seeds_count + seed_size; seed_index++)
{
- unsigned int seed_value
+ unsigned int seed
= seed_index < random_seeds_count ? rand() : seeds[seed_index - random_seeds_count];
- SCOPED_TRACE(testing::Message() << "with seed= " << seed_value);
+ SCOPED_TRACE(testing::Message() << "with seed= " << seed);
thrust::host_vector<T> h0 = get_random_data<T>(
- size, T(-1000), T(1000), seed_value);
+ size, T(-1000), T(1000), seed);
thrust::device_vector<T> d0(h0);
@@ -1081,12 +1073,12 @@ TYPED_TEST(AsyncReduceTests, TestAsyncReduceCaching)
SCOPED_TRACE(testing::Message() << "with size = " << size);
for(size_t seed_index = 0; seed_index < random_seeds_count + seed_size; seed_index++)
{
- unsigned int seed_value
+ unsigned int seed
= seed_index < random_seeds_count ? rand() : seeds[seed_index - random_seeds_count];
- SCOPED_TRACE(testing::Message() << "with seed= " << seed_value);
+ SCOPED_TRACE(testing::Message() << "with seed= " << seed);
thrust::host_vector<T> h0 = get_random_data<T>(
- size, T(-1000), T(1000), seed_value);
+ size, T(-1000), T(1000), seed);
constexpr std::int64_t m = 32;
thrust::device_vector<T> d0(h0);
@@ -1135,14 +1127,12 @@ TYPED_TEST(AsyncReduceTests, TestAsyncCopyThenReduce)
for(auto size : get_sizes())
{
SCOPED_TRACE(testing::Message() << "with size = " << size);
- for(size_t seed_index = 0; seed_index < random_seeds_count + seed_size; seed_index++)
+ for(auto seed : get_seeds())
{
- unsigned int seed_value
- = seed_index < random_seeds_count ? rand() : seeds[seed_index - random_seeds_count];
- SCOPED_TRACE(testing::Message() << "with seed= " << seed_value);
+ SCOPED_TRACE(testing::Message() << "with seed= " << seed);
thrust::host_vector<T> h0 = get_random_data<T>(
- size, T(-1000), T(1000), seed_value);
+ size, T(-1000), T(1000), seed);
thrust::device_vector<T> d0a(h0);
thrust::device_vector<T> d0b(h0);

MODIFY
test/test_async_sort.cpp
test/test_async_sort.cpp
@@ -26,72 +26,6 @@ struct custom_greater
}
};
-<<<<<<< HEAD
-TYPED_TEST(AsyncSortTests, AsyncSortInstance)
-{
- using T = typename TestFixture::input_type;
- for(auto size : get_sizes())
- {
- SCOPED_TRACE(testing::Message() << "with size = " << size);
- for(auto seed : get_seeds())
- {
- SCOPED_TRACE(testing::Message() << "with seed= " << seed);
-
- thrust::host_vector<T> h0_data = get_random_data<T>(
- size, std::numeric_limits<T>::min(), std::numeric_limits<T>::max(), seed);
- thrust::device_vector<T> d0_data(h0_data);
-
- ASSERT_EQ(h0_data, d0_data);
-
- thrust::sort(
- h0_data.begin(), h0_data.end()
- );
-
- auto f0 = thrust::async::sort(
- d0_data.begin(), d0_data.end()
- );
-
- f0.wait();
-
- ASSERT_EQ(h0_data, d0_data);
- }
- }
-};
-
-TYPED_TEST(AsyncSortTests, AsyncSortWithPolicyInstance)
-{
- using T = typename TestFixture::input_type;
- for(auto size : get_sizes())
- {
- SCOPED_TRACE(testing::Message() << "with size = " << size);
- for(auto seed : get_seeds())
- {
- SCOPED_TRACE(testing::Message() << "with seed= " << seed);
-
- thrust::host_vector<T> h0_data = get_random_data<T>(
- size, std::numeric_limits<T>::min(), std::numeric_limits<T>::max(), seed);
- thrust::device_vector<T> d0_data(h0_data);
-
- ASSERT_EQ(h0_data, d0_data);
-
- thrust::sort(
- h0_data.begin(), h0_data.end()
- );
-
- auto f0 = thrust::async::sort(
- thrust::device, d0_data.begin(), d0_data.end()
- );
-
- f0.wait();
-
- ASSERT_EQ(h0_data, d0_data);
- }
- }
-};
-
-template <typename T, typename Operator>
-void AsyncSortWithOperator()
-=======
#define DEFINE_SORT_INVOKER(name, ...) \
template <typename T> \
struct name \
@@ -191,6 +125,68 @@ DEFINE_SORT_OP_INVOKER(
#undef DEFINE_SORT_INVOKER
#undef DEFINE_SORT_OP_INVOKER
+TYPED_TEST(AsyncSortTests, AsyncSortInstance)
+{
+ using T = typename TestFixture::input_type;
+ for(auto size : get_sizes())
+ {
+ SCOPED_TRACE(testing::Message() << "with size = " << size);
+ for(auto seed : get_seeds())
+ {
+ SCOPED_TRACE(testing::Message() << "with seed= " << seed);
+
+ thrust::host_vector<T> h0_data = get_random_data<T>(
+ size, std::numeric_limits<T>::min(), std::numeric_limits<T>::max(), seed);
+ thrust::device_vector<T> d0_data(h0_data);
+
+ ASSERT_EQ(h0_data, d0_data);
+
+ thrust::sort(
+ h0_data.begin(), h0_data.end()
+ );
+
+ auto f0 = thrust::async::sort(
+ d0_data.begin(), d0_data.end()
+ );
+
+ f0.wait();
+
+ ASSERT_EQ(h0_data, d0_data);
+ }
+ }
+};
+
+TYPED_TEST(AsyncSortTests, AsyncSortWithPolicyInstance)
+{
+ using T = typename TestFixture::input_type;
+ for(auto size : get_sizes())
+ {
+ SCOPED_TRACE(testing::Message() << "with size = " << size);
+ for(auto seed : get_seeds())
+ {
+ SCOPED_TRACE(testing::Message() << "with seed= " << seed);
+
+ thrust::host_vector<T> h0_data = get_random_data<T>(
+ size, std::numeric_limits<T>::min(), std::numeric_limits<T>::max(), seed);
+ thrust::device_vector<T> d0_data(h0_data);
+
+ ASSERT_EQ(h0_data, d0_data);
+
+ thrust::sort(
+ h0_data.begin(), h0_data.end()
+ );
+
+ auto f0 = thrust::async::sort(
+ thrust::device, d0_data.begin(), d0_data.end()
+ );
+
+ f0.wait();
+
+ ASSERT_EQ(h0_data, d0_data);
+ }
+ }
+};
+
///////////////////////////////////////////////////////////////////////////////
template < typename T, template <typename> class SortInvoker, wait_policy WaitPolicy>

MODIFY
test/test_async_transform.cpp
test/test_async_transform.cpp
@@ -168,13 +168,11 @@ void test_async_transform_unary()
for(auto size : get_sizes())
{
SCOPED_TRACE(testing::Message() << "with size = " << size);
- for(size_t seed_index = 0; seed_index < random_seeds_count + seed_size; seed_index++)
+ for(auto seed : get_seeds())
{
- unsigned int seed_value
- = seed_index < random_seeds_count ? rand() : seeds[seed_index - random_seeds_count];
- SCOPED_TRACE(testing::Message() << "with seed= " << seed_value);
+ SCOPED_TRACE(testing::Message() << "with seed= " << seed);
- thrust::host_vector<T> h0 = get_random_data<T>(size, T(-1000), T(1000), seed_value);
+ thrust::host_vector<T> h0 = get_random_data<T>(size, T(-1000), T(1000), seed);
thrust::device_vector<T> d0a(h0);
thrust::device_vector<T> d0b(h0);
@@ -299,13 +297,11 @@ void test_async_transform_unary_inplace()
for(auto size : get_sizes())
{
SCOPED_TRACE(testing::Message() << "with size = " << size);
- for(size_t seed_index = 0; seed_index < random_seeds_count + seed_size; seed_index++)
+ for(auto seed : get_seeds())
{
- unsigned int seed_value
- = seed_index < random_seeds_count ? rand() : seeds[seed_index - random_seeds_count];
- SCOPED_TRACE(testing::Message() << "with seed= " << seed_value);
+ SCOPED_TRACE(testing::Message() << "with seed= " << seed);
- thrust::host_vector<T> h0 = get_random_data<T>(size, T(-1000), T(1000), seed_value);
+ thrust::host_vector<T> h0 = get_random_data<T>(size, T(-1000), T(1000), seed);
thrust::device_vector<T> d0a(h0);
thrust::device_vector<T> d0b(h0);

MODIFY
testing/CMakeLists.txt
testing/CMakeLists.txt
@@ -108,7 +108,7 @@ add_thrust_test("distance")
#add_thrust_test("equal") # undefined reference to `thrust::hip_rocprim::reference<int>::operator=(int const&)'
#add_thrust_test("fill") # lld: error: undefined hidden symbol: thrust::hip_rocprim::reference<int>::operator=(int const&)
#add_thrust_test("find") # undefined reference to `thrust::hip_rocprim::reference<int>::operator=(int const&)'
-add_thrust_test("for_each")
+#add_thrust_test("for_each")
add_thrust_test("functional_arithmetic")
add_thrust_test("functional_bitwise")
#add_thrust_test("functional") # lld: error: undefined hidden symbol: thrust::hip_rocprim::reference<int>::operator=(int const&)
@@ -139,7 +139,6 @@ add_thrust_test("min_and_max")
#add_thrust_test("min_element") # undefined reference to `thrust::hip_rocprim::reference<int>::operator=(int const&)'
#add_thrust_test("minmax_element") # undefined reference to `thrust::hip_rocprim::reference<int>::operator=(int const&)'
#add_thrust_test("mismatch") # undefined reference to `thrust::hip_rocprim::reference<int>::operator=(int const&)'
-add_thrust_test("mr_new")
add_thrust_test("mr_disjoint_pool")
add_thrust_test("mr_new")
add_thrust_test("mr_pool")
@@ -224,7 +223,6 @@ add_thrust_test("vector_allocators")
add_thrust_test("vector_insert")
add_thrust_test("vector_manipulation")
#add_thrust_test("zip_iterator") # lld: error: undefined hidden symbol: thrust::hip_rocprim::reference<int>::operator=(int const&)
-add_thrust_test("zip_iterator_reduce_by_key")
add_thrust_test("zip_iterator_reduce")
add_thrust_test("zip_iterator_reduce_by_key")
add_thrust_test("zip_iterator_scan")

Fix CMakeLists on testing folder