Fix merge request findings
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_smaller())
+ for (auto size : get_sizes())
{
SCOPED_TRACE(testing::Message() << "with size = " << size);
@@ -165,9 +165,10 @@ TYPED_TEST(TabulateTests, TestTabulate)
thrust::tabulate(h_data.begin(), h_data.end(), _1 * _1 + T(13));
thrust::tabulate(d_data.begin(), d_data.end(), _1 * _1 + T(13));
+ thrust::host_vector<T> h_result = d_data;
for (size_t i = 0; i < size; i++)
{
- ASSERT_EQ(h_data[i], d_data[i]) << "where index = " << i;
+ ASSERT_EQ(h_data[i], h_result[i]) << "where index = " << i;
}
thrust::tabulate(h_data.begin(), h_data.end(), (_1 - T(7)) * _1);
@@ -179,7 +180,7 @@ TYPED_TEST(TabulateTests, TestTabulate)
TEST(TabulateTests, TestTabulateToDiscardIterator)
{
- for (auto size : get_sizes_smaller())
+ for (auto size : get_sizes())
{
thrust::tabulate(thrust::discard_iterator<thrust::device_system_tag>(),
thrust::discard_iterator<thrust::device_system_tag>(size),

MODIFY
testing/tuple.cu
testing/tuple.cu
@@ -13,10 +13,7 @@ struct TestTupleConstructor
using namespace thrust;
host_vector<T> data = random_integers<T>(10);
- thrust::host_vector<T> data = get_random_data<T>(size,
- std::numeric_limits<T>::min(),
- std::numeric_limits<T>::max() );
- }
+
tuple<T> t1(data[0]);
ASSERT_EQUAL(data[0], get<0>(t1));

MODIFY
thrust/system/hip/detail/reduce.h
thrust/system/hip/detail/reduce.h
#include <thrust/distance.h>
#include <thrust/detail/alignment.h>
-// rocprim includes
-#include <rocprim/functional.hpp>
-#include <rocprim/device/device_reduce_hip.hpp>
+// rocprim include
+#include <rocprim/rocprim.hpp>
BEGIN_NS_THRUST
@@ -119,21 +118,7 @@ reduce_n(execution_policy<Derived> &policy,
stream, THRUST_HIP_DEBUG_SYNC_FLAG),
"after reduction step 2");
- // Synchronize the stream and get the value.
- hipDeviceSynchronize();
- hip_rocprim::throw_on_error(hipGetLastError(),
- "reduce failed to synchronize");
-
- // `tmp.begin()` yields a `normal_iterator`, which dereferences to a
- // `reference`, which has an `operator&` that returns a `pointer`, which
- // has a `.get` method that returns a raw pointer, which we can (finally)
- // `static_cast` to `void*`.
- //
- // The array was dynamically allocated, so we assume that it's suitably
- // aligned for any type of data. `malloc`/`cudaMalloc`/`new`/`std::allocator`
- // make this guarantee.
- return hip_rocprim::get_value(policy,
- detail::aligned_reinterpret_cast<T*>((&*tmp.begin()).get()));
+ return hip_rocprim::get_value(policy,ret_ptr);
#else // __THRUST_HAS_HIPRT__
return thrust::reduce(
cvt_to_seq(derived_cast(policy)), first, first + num_items, init, binary_op);
@@ -178,7 +163,7 @@ reduce(execution_policy<Derived> &policy,
}
-} // namespace rocprim
+} // namespace hip_rocprim
END_NS_THRUST

MODIFY
thrust/system/hip/detail/transform.h
thrust/system/hip/detail/transform.h
#include <thrust/system/hip/detail/parallel_for.h>
#include <thrust/distance.h>
-// rocPRIM includes
-#include <rocprim/functional.hpp>
-#include <rocprim/device/device_transform_hip.hpp>
+// rocPRIM include
+#include <rocprim/rocprim.hpp>
BEGIN_NS_THRUST

Fix merge request findings