Enable passing tests
MODIFY
testing/CMakeLists.txt
testing/CMakeLists.txt
@@ -74,18 +74,18 @@ add_thrust_test("copy_n")
# add_thrust_test("cstdint")
# add_thrust_test("dereference")
# add_thrust_test("device_delete")
-# add_thrust_test("device_ptr")
+add_thrust_test("device_ptr")
# add_thrust_test("device_reference")
-# add_thrust_test("discard_iterator")
-# add_thrust_test("distance")
+add_thrust_test("discard_iterator")
+add_thrust_test("distance")
# add_thrust_test("equal")
# add_thrust_test("fill")
# add_thrust_test("find")
-# add_thrust_test("for_each")
-# add_thrust_test("functional_arithmetic")
-# add_thrust_test("functional_bitwise")
-# add_thrust_test("functional")
-# add_thrust_test("functional_logical")
+add_thrust_test("for_each")
+add_thrust_test("functional_arithmetic")
+add_thrust_test("functional_bitwise")
+add_thrust_test("functional")
+add_thrust_test("functional_logical")
# add_thrust_test("functional_placeholders_arithmetic")
# add_thrust_test("functional_placeholders_bitwise")
# add_thrust_test("functional_placeholders_compound_assignment")
@@ -104,17 +104,17 @@ add_thrust_test("copy_n")
# add_thrust_test("merge_by_key")
# add_thrust_test("merge")
# add_thrust_test("merge_key_value")
-# add_thrust_test("metaprogamming")
+add_thrust_test("metaprogamming")
# add_thrust_test("min_and_max")
# add_thrust_test("min_element")
# add_thrust_test("minmax_element")
# add_thrust_test("mismatch")
-# add_thrust_test("pair")
+add_thrust_test("pair")
# add_thrust_test("pair_reduce")
# add_thrust_test("pair_scan_by_key")
# add_thrust_test("pair_scan")
-# add_thrust_test("pair_sort_by_key")
-# add_thrust_test("pair_sort")
+add_thrust_test("pair_sort_by_key")
+add_thrust_test("pair_sort")
# add_thrust_test("pair_transform")
# add_thrust_test("partition")
# add_thrust_test("partition_point")
@@ -130,7 +130,7 @@ add_thrust_test("copy_n")
# add_thrust_test("scan_by_key")
# add_thrust_test("scan")
# add_thrust_test("scatter")
-# add_thrust_test("sequence")
+add_thrust_test("sequence")
# add_thrust_test("set_difference_by_key")
# add_thrust_test("set_difference_by_key_descending")
# add_thrust_test("set_difference")
@@ -153,13 +153,13 @@ add_thrust_test("copy_n")
add_thrust_test("sort_by_key")
add_thrust_test("sort_by_key_variable_bits")
add_thrust_test("sort")
-# add_thrust_test("sort_permutation_iterator")
+add_thrust_test("sort_permutation_iterator")
add_thrust_test("sort_variable_bits")
add_thrust_test("stable_sort_by_key")
add_thrust_test("stable_sort_by_key_large")
add_thrust_test("stable_sort")
add_thrust_test("stable_sort_large")
-# add_thrust_test("swap_ranges")
+add_thrust_test("swap_ranges")
add_thrust_test("tabulate")
add_thrust_test("transform")
# add_thrust_test("transform_iterator")
@@ -172,18 +172,18 @@ add_thrust_test("transform")
# add_thrust_test("tuple_scan")
# add_thrust_test("tuple_sort")
# add_thrust_test("tuple_transform")
-# add_thrust_test("type_traits")
-# add_thrust_test("uninitialized_copy")
+add_thrust_test("type_traits")
+add_thrust_test("uninitialized_copy")
# add_thrust_test("uninitialized_fill")
# add_thrust_test("unique_by_key")
# add_thrust_test("unique")
-# add_thrust_test("unittest_tester")
+add_thrust_test("unittest_tester")
# add_thrust_test("vector")
# add_thrust_test("vector_insert")
-# add_thrust_test("vector_manipulation")
+add_thrust_test("vector_manipulation")
# add_thrust_test("zip_iterator")
# add_thrust_test("zip_iterator_reduce_by_key")
# add_thrust_test("zip_iterator_reduce")
# add_thrust_test("zip_iterator_scan")
-# add_thrust_test("zip_iterator_sort_by_key")
-# add_thrust_test("zip_iterator_sort")
+add_thrust_test("zip_iterator_sort_by_key")
+add_thrust_test("zip_iterator_sort")

MODIFY
testing/fill.cu
testing/fill.cu
@@ -383,7 +383,7 @@ DECLARE_UNITTEST(TestFillWithNonTrivialAssignment);
template<typename ForwardIterator, typename T>
-void fill(my_system &system, ForwardIterator first, ForwardIterator, const T&)
+void fill(my_system &system, ForwardIterator, ForwardIterator, const T&)
{
system.validate_dispatch();
}

MODIFY
testing/for_each.cu
testing/for_each.cu
@@ -43,6 +43,7 @@ DECLARE_VECTOR_UNITTEST(TestForEachSimple);
template<typename InputIterator, typename Function>
+__host__ __device__
InputIterator for_each(my_system &system, InputIterator first, InputIterator, Function)
{
system.validate_dispatch();
@@ -62,6 +63,7 @@ DECLARE_UNITTEST(TestForEachDispatchExplicit);
template<typename InputIterator, typename Function>
+__host__ __device__
InputIterator for_each(my_tag, InputIterator first, InputIterator, Function)
{
*first = 13;
@@ -109,6 +111,7 @@ DECLARE_VECTOR_UNITTEST(TestForEachNSimple);
template<typename InputIterator, typename Size, typename Function>
+__host__ __device__
InputIterator for_each_n(my_system &system, InputIterator first, Size, Function)
{
system.validate_dispatch();
@@ -128,6 +131,7 @@ DECLARE_UNITTEST(TestForEachNDispatchExplicit);
template<typename InputIterator, typename Size, typename Function>
+__host__ __device__
InputIterator for_each_n(my_tag, InputIterator first, Size, Function)
{
*first = 13;

MODIFY
testing/generate.cu
testing/generate.cu
@@ -40,7 +40,8 @@ DECLARE_VECTOR_UNITTEST(TestGenerateSimple);
template<typename ForwardIterator, typename Generator>
-void generate(my_system &system, ForwardIterator first, ForwardIterator, Generator)
+__host__ __device__
+void generate(my_system &system, ForwardIterator, ForwardIterator, Generator)
{
system.validate_dispatch();
}
@@ -58,6 +59,7 @@ DECLARE_UNITTEST(TestGenerateDispatchExplicit);
template<typename ForwardIterator, typename Generator>
+__host__ __device__
void generate(my_tag, ForwardIterator first, ForwardIterator, Generator)
{
*first = 13;
@@ -94,6 +96,7 @@ DECLARE_VARIABLE_UNITTEST(TestGenerate);
template <typename T>
void TestGenerateToDiscardIterator(const size_t n)
{
+ (void)n;
T value = 13;
return_value<T> f(value);
@@ -130,6 +133,7 @@ DECLARE_VECTOR_UNITTEST(TestGenerateNSimple);
template<typename ForwardIterator, typename Size, typename Generator>
+__host__ __device__
ForwardIterator generate_n(my_system &system, ForwardIterator first, Size, Generator)
{
system.validate_dispatch();
@@ -149,6 +153,7 @@ DECLARE_UNITTEST(TestGenerateNDispatchExplicit);
template<typename ForwardIterator, typename Size, typename Generator>
+__host__ __device__
ForwardIterator generate_n(my_tag, ForwardIterator first, Size, Generator)
{
*first = 13;

MODIFY
testing/sequence.cu
testing/sequence.cu
template<typename ForwardIterator>
-void sequence(my_system &system, ForwardIterator first, ForwardIterator)
+void sequence(my_system &system, ForwardIterator, ForwardIterator)
{
system.validate_dispatch();
}
@@ -114,4 +114,3 @@ void TestSequenceToDiscardIterator(size_t n)
// nothing to check -- just make sure it compiles
}
DECLARE_VARIABLE_UNITTEST(TestSequenceToDiscardIterator);
-

MODIFY
testing/uninitialized_copy.cu
testing/uninitialized_copy.cu
@@ -147,6 +147,7 @@ struct CopyConstructTest
__host__ __device__
CopyConstructTest(const CopyConstructTest &exemplar)
{
+ (void)exemplar;
#if __CUDA_ARCH__
copy_constructed_on_device = true;
copy_constructed_on_host = false;
@@ -173,6 +174,7 @@ struct TestUninitializedCopyNonPODDevice
{
void operator()(const size_t dummy)
{
+ (void)dummy;
typedef CopyConstructTest T;
thrust::device_vector<T> v1(5), v2(5);
@@ -199,6 +201,7 @@ struct TestUninitializedCopyNNonPODDevice
{
void operator()(const size_t dummy)
{
+ (void)dummy;
typedef CopyConstructTest T;
thrust::device_vector<T> v1(5), v2(5);
@@ -225,6 +228,7 @@ struct TestUninitializedCopyNonPODHost
{
void operator()(const size_t dummy)
{
+ (void)dummy;
typedef CopyConstructTest T;
thrust::host_vector<T> v1(5), v2(5);
@@ -251,6 +255,7 @@ struct TestUninitializedCopyNNonPODHost
{
void operator()(const size_t dummy)
{
+ (void)dummy;
typedef CopyConstructTest T;
thrust::host_vector<T> v1(5), v2(5);
@@ -271,4 +276,3 @@ struct TestUninitializedCopyNNonPODHost
}
};
DECLARE_UNITTEST(TestUninitializedCopyNNonPODHost);
-

MODIFY
thrust/system/hip/detail/util.h
thrust/system/hip/detail/util.h
@@ -70,7 +70,8 @@ trivial_copy_from_device(Type * dst,
sizeof(Type) * count,
hipMemcpyDeviceToHost,
stream);
- hipStreamSynchronize(stream);
+ if (status != hipSuccess) return status;
+ status = hipStreamSynchronize(stream);
return status;
}
@@ -89,7 +90,8 @@ trivial_copy_to_device(Type * dst,
sizeof(Type) * count,
hipMemcpyHostToDevice,
stream);
- hipStreamSynchronize(stream);
+ if (status != hipSuccess) return status;
+ status = hipStreamSynchronize(stream);
return status;
}
template <class Policy, class Type>

Enable passing tests