From ff2597fc3aa4453f1dcac3df2116992694a6a6f7 Mon Sep 17 00:00:00 2001 From: Nathan Bell Date: Thu, 15 Apr 2010 12:07:49 -0700 Subject: [PATCH] renamed thrusttest->unittest --HG-- rename : testing/thrusttest/assertions.h => testing/unittest/assertions.h rename : testing/thrusttest/exceptions.h => testing/unittest/exceptions.h rename : testing/thrusttest/meta.h => testing/unittest/meta.h rename : testing/thrusttest/random.h => testing/unittest/random.h rename : testing/thrusttest/special_types.h => testing/unittest/special_types.h rename : testing/thrusttest/system.h => testing/unittest/system.h rename : testing/thrusttest/testframework.h => testing/unittest/testframework.h rename : testing/thrusttest/unittest.h => testing/unittest/unittest.h rename : testing/thrusttest/util.h => testing/unittest/util.h --- performance/adjacent_difference.test | 2 +- performance/axpy.test | 4 +- performance/binary_search.test | 4 +- performance/build/perftest.h | 2 +- performance/build/test_function_template.cxx | 2 +- performance/build/test_program_template.cxx | 2 +- performance/float3_optimization.test | 6 +-- performance/host_sort.test | 2 +- performance/host_sort_by_key.test | 2 +- performance/inclusive_scan.test | 2 +- performance/inclusive_segmented_scan.test | 2 +- performance/inner_product.test | 4 +- performance/merge_sort.test | 2 +- performance/merge_sort_by_key.test | 2 +- performance/nrm2.test | 2 +- performance/omp_merge_sort.test | 2 +- performance/radix_sort.test | 2 +- performance/radix_sort_bits.test | 2 +- performance/radix_sort_by_key.test | 2 +- performance/reduce.test | 2 +- performance/reduce_float.test | 2 +- performance/sort.test | 2 +- performance/sort_by_key.test | 2 +- performance/sort_large.test | 2 +- performance/stl_sort.test | 2 +- performance/unique.test | 2 +- testing/adjacent_difference.cu | 4 +- testing/advance.cu | 2 +- testing/arch.cu | 2 +- testing/binary_search.cu | 14 +++--- testing/constant_iterator.cu | 2 +- testing/copy.cu | 10 ++--- testing/count.cu | 6 +-- testing/counting_iterator.cu | 4 +- testing/cuda/merge_sort.cu | 14 +++--- testing/cuda/pinned_allocator.cu | 4 +- testing/cuda/radix_sort.cu | 20 ++++----- testing/dereference.cu | 8 ++-- testing/device_delete.cu | 2 +- testing/device_ptr.cu | 2 +- testing/device_reference.cu | 2 +- testing/distance.cu | 2 +- testing/equal.cu | 6 +-- testing/fill.cu | 4 +- testing/find.cu | 2 +- testing/for_each.cu | 4 +- testing/functional.cu | 8 ++-- testing/gather.cu | 22 +++++----- testing/generate.cu | 2 +- testing/inner_product.cu | 6 +-- testing/is_sorted.cu | 4 +- testing/logical.cu | 2 +- testing/max_element.cu | 4 +- testing/metaprogamming.cu | 2 +- testing/min_element.cu | 4 +- testing/minmax_element.cu | 4 +- testing/mismatch.cu | 2 +- testing/pair.cu | 28 ++++++------ testing/partition.cu | 10 ++--- testing/permutation_iterator.cu | 2 +- testing/random.cu | 2 +- testing/reduce.cu | 10 ++--- testing/remove.cu | 18 ++++---- testing/replace.cu | 18 ++++---- testing/reverse_iterator.cu | 4 +- testing/scan.cu | 21 +++++---- testing/scatter.cu | 6 +-- testing/segmented_scan.cu | 10 ++--- testing/sequence.cu | 2 +- testing/set_intersection.cu | 12 ++--- testing/sort.cu | 26 +++++------ testing/swap_ranges.cu | 6 +-- testing/testframework.cu | 12 ++--- testing/thrusttest/unittest.h | 11 ----- testing/transform.cu | 24 +++++----- testing/transform_iterator.cu | 4 +- testing/transform_reduce.cu | 6 +-- testing/transform_scan.cu | 4 +- testing/trivial_sequence.cu | 2 +- testing/tuple.cu | 20 ++++----- testing/type_traits.cu | 2 +- testing/uninitialized_copy.cu | 6 +-- testing/uninitialized_fill.cu | 36 +++++++-------- testing/unique.cu | 14 +++--- testing/{thrusttest => unittest}/assertions.h | 38 ++++++++-------- testing/{thrusttest => unittest}/exceptions.h | 4 +- testing/{thrusttest => unittest}/meta.h | 4 +- testing/{thrusttest => unittest}/random.h | 4 +- .../{thrusttest => unittest}/special_types.h | 0 testing/{thrusttest => unittest}/system.h | 4 +- .../{thrusttest => unittest}/testframework.h | 44 +++++++++---------- testing/unittest/unittest.h | 11 +++++ testing/{thrusttest => unittest}/util.h | 4 +- testing/unittest_tester.cu | 2 +- testing/vector.cu | 10 ++--- testing/vector_cpp_subset.cpp | 10 ++--- testing/zip_iterator.cu | 30 ++++++------- 97 files changed, 358 insertions(+), 359 deletions(-) delete mode 100644 testing/thrusttest/unittest.h rename testing/{thrusttest => unittest}/assertions.h (89%) rename testing/{thrusttest => unittest}/exceptions.h (95%) rename testing/{thrusttest => unittest}/meta.h (99%) rename testing/{thrusttest => unittest}/random.h (96%) rename testing/{thrusttest => unittest}/special_types.h (100%) rename testing/{thrusttest => unittest}/system.h (92%) rename testing/{thrusttest => unittest}/testframework.h (85%) create mode 100644 testing/unittest/unittest.h rename testing/{thrusttest => unittest}/util.h (84%) diff --git a/performance/adjacent_difference.test b/performance/adjacent_difference.test index 681b12da8..819a5562d 100644 --- a/performance/adjacent_difference.test +++ b/performance/adjacent_difference.test @@ -5,7 +5,7 @@ PREAMBLE = \ INITIALIZE = \ """ - thrust::host_vector<$InputType> h_input = thrusttest::random_integers<$InputType>($InputSize); + thrust::host_vector<$InputType> h_input = unittest::random_integers<$InputType>($InputSize); thrust::device_vector<$InputType> d_input = h_input; thrust::host_vector<$InputType> h_output($InputSize); diff --git a/performance/axpy.test b/performance/axpy.test index 2b601e1fa..9534ae932 100644 --- a/performance/axpy.test +++ b/performance/axpy.test @@ -50,8 +50,8 @@ INITIALIZE = \ """ //cublasInit(); - thrust::host_vector<$InputType> h_x = thrusttest::random_samples<$InputType>($InputSize); - thrust::host_vector<$InputType> h_y = thrusttest::random_samples<$InputType>($InputSize); + thrust::host_vector<$InputType> h_x = unittest::random_samples<$InputType>($InputSize); + thrust::host_vector<$InputType> h_y = unittest::random_samples<$InputType>($InputSize); thrust::device_vector<$InputType> d_x = h_x; thrust::device_vector<$InputType> d_y = h_y; diff --git a/performance/binary_search.test b/performance/binary_search.test index 6ae25a548..cd0a22993 100644 --- a/performance/binary_search.test +++ b/performance/binary_search.test @@ -6,7 +6,7 @@ PREAMBLE = \ INITIALIZE = \ """ - thrust::host_vector<$KeyType> h_keys = thrusttest::random_integers<$KeyType>($InputSize); + thrust::host_vector<$KeyType> h_keys = unittest::random_integers<$KeyType>($InputSize); thrust::device_vector<$KeyType> d_keys = h_keys; thrust::sort(h_keys.begin(), h_keys.end()); @@ -14,7 +14,7 @@ INITIALIZE = \ ASSERT_EQUAL(d_keys, h_keys); - thrust::host_vector<$KeyType> h_search = thrusttest::random_integers<$KeyType>($InputSize); + thrust::host_vector<$KeyType> h_search = unittest::random_integers<$KeyType>($InputSize); thrust::device_vector<$KeyType> d_search = h_search; thrust::host_vector h_output($InputSize); diff --git a/performance/build/perftest.h b/performance/build/perftest.h index 9dc1536c6..5a6f535db 100644 --- a/performance/build/perftest.h +++ b/performance/build/perftest.h @@ -1,4 +1,4 @@ -#include +#include #include #include #include diff --git a/performance/build/test_function_template.cxx b/performance/build/test_function_template.cxx index 7f035900b..0929816de 100644 --- a/performance/build/test_function_template.cxx +++ b/performance/build/test_function_template.cxx @@ -86,7 +86,7 @@ void $FUNCTION(void) catch (std::bad_alloc) { RECORD_TEST_FAILURE("std::bad_alloc"); } - catch (thrusttest::UnitTestException e) { + catch (unittest::UnitTestException e) { RECORD_TEST_FAILURE(e); } diff --git a/performance/build/test_program_template.cxx b/performance/build/test_program_template.cxx index 317bb4aad..3b256b768 100644 --- a/performance/build/test_program_template.cxx +++ b/performance/build/test_program_template.cxx @@ -1,4 +1,4 @@ -#include +#include /*********** BEGIN PREAMBLE SECTION ***********/ $PREAMBLE diff --git a/performance/float3_optimization.test b/performance/float3_optimization.test index 0903aaf92..2dd23ef64 100644 --- a/performance/float3_optimization.test +++ b/performance/float3_optimization.test @@ -66,9 +66,9 @@ PREAMBLE = \ INITIALIZE = \ """ - thrust::host_vector<$InputType> h_x = thrusttest::random_samples<$InputType>($InputSize); - thrust::host_vector<$InputType> h_y = thrusttest::random_samples<$InputType>($InputSize); - thrust::host_vector<$InputType> h_z = thrusttest::random_samples<$InputType>($InputSize); + thrust::host_vector<$InputType> h_x = unittest::random_samples<$InputType>($InputSize); + thrust::host_vector<$InputType> h_y = unittest::random_samples<$InputType>($InputSize); + thrust::host_vector<$InputType> h_z = unittest::random_samples<$InputType>($InputSize); thrust::device_vector<$InputType> d_x = h_x; thrust::device_vector<$InputType> d_y = h_y; thrust::device_vector<$InputType> d_z = h_z; diff --git a/performance/host_sort.test b/performance/host_sort.test index d7dde2413..db66de963 100644 --- a/performance/host_sort.test +++ b/performance/host_sort.test @@ -7,7 +7,7 @@ PREAMBLE = \ INITIALIZE = \ """ - thrust::host_vector<$KeyType> h_keys = thrusttest::random_integers<$KeyType>($InputSize); + thrust::host_vector<$KeyType> h_keys = unittest::random_integers<$KeyType>($InputSize); thrust::host_vector<$KeyType> h_keys_copy(h_keys); // test sort diff --git a/performance/host_sort_by_key.test b/performance/host_sort_by_key.test index e7b623c99..8814c2446 100644 --- a/performance/host_sort_by_key.test +++ b/performance/host_sort_by_key.test @@ -6,7 +6,7 @@ PREAMBLE = \ INITIALIZE = \ """ - thrust::host_vector<$KeyType> h_keys = thrusttest::random_integers<$KeyType>($InputSize); + thrust::host_vector<$KeyType> h_keys = unittest::random_integers<$KeyType>($InputSize); thrust::host_vector<$KeyType> h_keys_copy(h_keys); thrust::host_vector<$KeyType> h_values($InputSize); diff --git a/performance/inclusive_scan.test b/performance/inclusive_scan.test index ee7b0502c..98b9a5b02 100644 --- a/performance/inclusive_scan.test +++ b/performance/inclusive_scan.test @@ -5,7 +5,7 @@ PREAMBLE = \ INITIALIZE = \ """ - thrust::host_vector<$InputType> h_input = thrusttest::random_integers<$InputType>($InputSize); + thrust::host_vector<$InputType> h_input = unittest::random_integers<$InputType>($InputSize); thrust::device_vector<$InputType> d_input = h_input; thrust::host_vector<$InputType> h_output($InputSize); diff --git a/performance/inclusive_segmented_scan.test b/performance/inclusive_segmented_scan.test index f9d190ceb..3343ac47b 100644 --- a/performance/inclusive_segmented_scan.test +++ b/performance/inclusive_segmented_scan.test @@ -5,7 +5,7 @@ PREAMBLE = \ INITIALIZE = \ """ - thrust::host_vector<$InputType> h_input = thrusttest::random_integers<$InputType>($InputSize); + thrust::host_vector<$InputType> h_input = unittest::random_integers<$InputType>($InputSize); thrust::device_vector<$InputType> d_input = h_input; thrust::host_vector<$InputType> h_output($InputSize); diff --git a/performance/inner_product.test b/performance/inner_product.test index d55ceb490..e043ce60c 100644 --- a/performance/inner_product.test +++ b/performance/inner_product.test @@ -5,8 +5,8 @@ PREAMBLE = \ INITIALIZE = \ """ - thrust::host_vector<$InputType> h_input1 = thrusttest::random_integers<$InputType>($InputSize); - thrust::host_vector<$InputType> h_input2 = thrusttest::random_integers<$InputType>($InputSize); + thrust::host_vector<$InputType> h_input1 = unittest::random_integers<$InputType>($InputSize); + thrust::host_vector<$InputType> h_input2 = unittest::random_integers<$InputType>($InputSize); thrust::device_vector<$InputType> d_input1 = h_input1; thrust::device_vector<$InputType> d_input2 = h_input2; diff --git a/performance/merge_sort.test b/performance/merge_sort.test index 0e5c0c31a..6b42241a7 100644 --- a/performance/merge_sort.test +++ b/performance/merge_sort.test @@ -6,7 +6,7 @@ PREAMBLE = \ INITIALIZE = \ """ - thrust::host_vector<$KeyType> h_keys = thrusttest::random_integers<$KeyType>($InputSize); + thrust::host_vector<$KeyType> h_keys = unittest::random_integers<$KeyType>($InputSize); thrust::device_vector<$KeyType> d_keys = h_keys; thrust::device_vector<$KeyType> d_keys_copy = d_keys; diff --git a/performance/merge_sort_by_key.test b/performance/merge_sort_by_key.test index 115d6b69a..625bc7303 100644 --- a/performance/merge_sort_by_key.test +++ b/performance/merge_sort_by_key.test @@ -6,7 +6,7 @@ PREAMBLE = \ INITIALIZE = \ """ - thrust::host_vector<$KeyType> h_keys = thrusttest::random_integers<$KeyType>($InputSize); + thrust::host_vector<$KeyType> h_keys = unittest::random_integers<$KeyType>($InputSize); thrust::device_vector<$KeyType> d_keys = h_keys; thrust::host_vector<$ValueType> h_values($InputSize); diff --git a/performance/nrm2.test b/performance/nrm2.test index 3776224fd..5640d7934 100644 --- a/performance/nrm2.test +++ b/performance/nrm2.test @@ -41,7 +41,7 @@ PREAMBLE = \ INITIALIZE = \ """ - thrust::host_vector<$InputType> h_input = thrusttest::random_integers($InputSize); + thrust::host_vector<$InputType> h_input = unittest::random_integers($InputSize); thrust::device_vector<$InputType> d_input = h_input; $InputType h_result = $Method(h_input); diff --git a/performance/omp_merge_sort.test b/performance/omp_merge_sort.test index 01e4fdfdd..eb7dd90ba 100644 --- a/performance/omp_merge_sort.test +++ b/performance/omp_merge_sort.test @@ -6,7 +6,7 @@ PREAMBLE = \ INITIALIZE = \ """ - thrust::host_vector<$KeyType> h_keys = thrusttest::random_integers<$KeyType>($InputSize); + thrust::host_vector<$KeyType> h_keys = unittest::random_integers<$KeyType>($InputSize); thrust::device_vector<$KeyType> d_keys = h_keys; thrust::device_vector<$KeyType> d_keys_copy = d_keys; diff --git a/performance/radix_sort.test b/performance/radix_sort.test index aaf221498..8169dda9c 100644 --- a/performance/radix_sort.test +++ b/performance/radix_sort.test @@ -6,7 +6,7 @@ PREAMBLE = \ INITIALIZE = \ """ - thrust::host_vector<$KeyType> h_keys = thrusttest::random_integers<$KeyType>($InputSize); + thrust::host_vector<$KeyType> h_keys = unittest::random_integers<$KeyType>($InputSize); thrust::device_vector<$KeyType> d_keys = h_keys; thrust::device_vector<$KeyType> d_keys_copy = d_keys; diff --git a/performance/radix_sort_bits.test b/performance/radix_sort_bits.test index 067eb53db..a1a843168 100644 --- a/performance/radix_sort_bits.test +++ b/performance/radix_sort_bits.test @@ -6,7 +6,7 @@ PREAMBLE = \ INITIALIZE = \ """ const size_t InputSize = 1 << 24; - thrust::host_vector<$KeyType> h_keys = thrusttest::random_integers<$KeyType>(InputSize); + thrust::host_vector<$KeyType> h_keys = unittest::random_integers<$KeyType>(InputSize); // set upper bits to zero for(size_t i = 0; i < InputSize; i++) diff --git a/performance/radix_sort_by_key.test b/performance/radix_sort_by_key.test index 4c6d81fd5..251d74461 100644 --- a/performance/radix_sort_by_key.test +++ b/performance/radix_sort_by_key.test @@ -6,7 +6,7 @@ PREAMBLE = \ INITIALIZE = \ """ - thrust::host_vector<$KeyType> h_keys = thrusttest::random_integers<$KeyType>($InputSize); + thrust::host_vector<$KeyType> h_keys = unittest::random_integers<$KeyType>($InputSize); thrust::device_vector<$KeyType> d_keys = h_keys; thrust::host_vector<$ValueType> h_values($InputSize); diff --git a/performance/reduce.test b/performance/reduce.test index 3c4fecc1f..6eea3b472 100644 --- a/performance/reduce.test +++ b/performance/reduce.test @@ -5,7 +5,7 @@ PREAMBLE = \ INITIALIZE = \ """ - thrust::host_vector<$InputType> h_input = thrusttest::random_integers<$InputType>($InputSize); + thrust::host_vector<$InputType> h_input = unittest::random_integers<$InputType>($InputSize); thrust::device_vector<$InputType> d_input = h_input; $InputType init = 13; diff --git a/performance/reduce_float.test b/performance/reduce_float.test index e513a99af..8dda319a3 100644 --- a/performance/reduce_float.test +++ b/performance/reduce_float.test @@ -5,7 +5,7 @@ PREAMBLE = \ INITIALIZE = \ """ - thrust::host_vector<$InputType> h_input = thrusttest::random_samples<$InputType>($InputSize); + thrust::host_vector<$InputType> h_input = unittest::random_samples<$InputType>($InputSize); thrust::device_vector<$InputType> d_input = h_input; $InputType init = 13; diff --git a/performance/sort.test b/performance/sort.test index 9b8bc8669..bcbbfe447 100644 --- a/performance/sort.test +++ b/performance/sort.test @@ -5,7 +5,7 @@ PREAMBLE = \ INITIALIZE = \ """ - thrust::host_vector<$KeyType> h_keys = thrusttest::random_integers<$KeyType>($InputSize); + thrust::host_vector<$KeyType> h_keys = unittest::random_integers<$KeyType>($InputSize); thrust::device_vector<$KeyType> d_keys = h_keys; thrust::device_vector<$KeyType> d_keys_copy = d_keys; diff --git a/performance/sort_by_key.test b/performance/sort_by_key.test index ab4589526..a132c5fc8 100644 --- a/performance/sort_by_key.test +++ b/performance/sort_by_key.test @@ -6,7 +6,7 @@ PREAMBLE = \ INITIALIZE = \ """ - thrust::host_vector<$KeyType> h_keys = thrusttest::random_integers<$KeyType>($InputSize); + thrust::host_vector<$KeyType> h_keys = unittest::random_integers<$KeyType>($InputSize); thrust::device_vector<$KeyType> d_keys = h_keys; thrust::host_vector<$ValueType> h_values($InputSize); diff --git a/performance/sort_large.test b/performance/sort_large.test index ca83f39d1..722367b7a 100644 --- a/performance/sort_large.test +++ b/performance/sort_large.test @@ -5,7 +5,7 @@ PREAMBLE = \ INITIALIZE = \ """ - thrust::host_vector<$KeyType> h_keys = thrusttest::random_integers<$KeyType>($InputSize); + thrust::host_vector<$KeyType> h_keys = unittest::random_integers<$KeyType>($InputSize); thrust::device_vector<$KeyType> d_keys = h_keys; thrust::device_vector<$KeyType> d_keys_copy = d_keys; diff --git a/performance/stl_sort.test b/performance/stl_sort.test index bf458c82a..20b3aa188 100644 --- a/performance/stl_sort.test +++ b/performance/stl_sort.test @@ -5,7 +5,7 @@ PREAMBLE = \ INITIALIZE = \ """ - thrust::host_vector<$KeyType> h_keys = thrusttest::random_integers<$KeyType>($InputSize); + thrust::host_vector<$KeyType> h_keys = unittest::random_integers<$KeyType>($InputSize); thrust::host_vector<$KeyType> h_keys_copy = h_keys; """ diff --git a/performance/unique.test b/performance/unique.test index 9d43770e3..99c3aac8a 100644 --- a/performance/unique.test +++ b/performance/unique.test @@ -5,7 +5,7 @@ PREAMBLE = \ INITIALIZE = \ """ - thrust::host_vector<$InputType> h_input = thrusttest::random_integers<$InputType>($InputSize); + thrust::host_vector<$InputType> h_input = unittest::random_integers<$InputType>($InputSize); // increase likelihood of equal consecutive elements for(size_t i = 0; i < $InputSize; i++) diff --git a/testing/adjacent_difference.cu b/testing/adjacent_difference.cu index c7f57047f..8a259587f 100644 --- a/testing/adjacent_difference.cu +++ b/testing/adjacent_difference.cu @@ -1,4 +1,4 @@ -#include +#include #include template @@ -40,7 +40,7 @@ DECLARE_VECTOR_UNITTEST(TestAjacentDifferenceSimple); template void TestAjacentDifference(const size_t n) { - thrust::host_vector h_input = thrusttest::random_samples(n); + thrust::host_vector h_input = unittest::random_samples(n); thrust::device_vector d_input = h_input; thrust::host_vector h_output(n); diff --git a/testing/advance.cu b/testing/advance.cu index 1c49b63ad..99900b6a9 100644 --- a/testing/advance.cu +++ b/testing/advance.cu @@ -1,4 +1,4 @@ -#include +#include #include #include diff --git a/testing/arch.cu b/testing/arch.cu index f944694f2..fa07ed139 100644 --- a/testing/arch.cu +++ b/testing/arch.cu @@ -1,4 +1,4 @@ -#include +#include #if defined(__CUDACC__) diff --git a/testing/binary_search.cu b/testing/binary_search.cu index 45031cbb7..e5b3e76fd 100644 --- a/testing/binary_search.cu +++ b/testing/binary_search.cu @@ -1,4 +1,4 @@ -#include +#include #include #include @@ -316,13 +316,13 @@ struct TestVectorLowerBound #if (THRUST_HOST_COMPILER == THRUST_HOST_COMPILER_MSVC) && (THRUST_DEVICE_BACKEND == THRUST_DEVICE_BACKEND_OMP) KNOWN_FAILURE; #else - thrust::host_vector h_vec = thrusttest::random_integers(n); + thrust::host_vector h_vec = unittest::random_integers(n); thrust::device_vector d_vec = h_vec; thrust::sort(h_vec.begin(), h_vec.end()); thrust::sort(d_vec.begin(), d_vec.end()); - thrust::host_vector h_input = thrusttest::random_integers(4*n); + thrust::host_vector h_input = unittest::random_integers(4*n); thrust::device_vector d_input = h_input; thrust::host_vector h_output(4*n); @@ -348,13 +348,13 @@ struct TestVectorUpperBound #if (THRUST_HOST_COMPILER == THRUST_HOST_COMPILER_MSVC) && (THRUST_DEVICE_BACKEND == THRUST_DEVICE_BACKEND_OMP) KNOWN_FAILURE; #else - thrust::host_vector h_vec = thrusttest::random_integers(n); + thrust::host_vector h_vec = unittest::random_integers(n); thrust::device_vector d_vec = h_vec; thrust::sort(h_vec.begin(), h_vec.end()); thrust::sort(d_vec.begin(), d_vec.end()); - thrust::host_vector h_input = thrusttest::random_integers(4*n); + thrust::host_vector h_input = unittest::random_integers(4*n); thrust::device_vector d_input = h_input; thrust::host_vector h_output(4*n); @@ -379,13 +379,13 @@ struct TestVectorBinarySearch #if (THRUST_HOST_COMPILER == THRUST_HOST_COMPILER_MSVC) && (THRUST_DEVICE_BACKEND == THRUST_DEVICE_BACKEND_OMP) KNOWN_FAILURE; #else - thrust::host_vector h_vec = thrusttest::random_integers(n); + thrust::host_vector h_vec = unittest::random_integers(n); thrust::device_vector d_vec = h_vec; thrust::sort(h_vec.begin(), h_vec.end()); thrust::sort(d_vec.begin(), d_vec.end()); - thrust::host_vector h_input = thrusttest::random_integers(4*n); + thrust::host_vector h_input = unittest::random_integers(4*n); thrust::device_vector d_input = h_input; thrust::host_vector h_output(4*n); diff --git a/testing/constant_iterator.cu b/testing/constant_iterator.cu index 3bd19b212..4525abf4f 100644 --- a/testing/constant_iterator.cu +++ b/testing/constant_iterator.cu @@ -1,4 +1,4 @@ -#include +#include #include #include #include diff --git a/testing/copy.cu b/testing/copy.cu index a44854bd8..7fb9b04ad 100644 --- a/testing/copy.cu +++ b/testing/copy.cu @@ -1,4 +1,4 @@ -#include +#include #include #include @@ -223,7 +223,7 @@ DECLARE_VECTOR_UNITTEST(TestCopyIfSimple); template void TestCopyIf(const size_t n) { - thrust::host_vector h_data = thrusttest::random_samples(n); + thrust::host_vector h_data = unittest::random_samples(n); thrust::device_vector d_data = h_data; thrust::host_vector h_result(n); @@ -268,11 +268,11 @@ DECLARE_VECTOR_UNITTEST(TestCopyIfStencilSimple); template void TestCopyIfStencil(const size_t n) { - thrust::host_vector h_data = thrusttest::random_samples(n); + thrust::host_vector h_data = unittest::random_samples(n); thrust::device_vector d_data = h_data; - thrust::host_vector h_stencil = thrusttest::random_samples(n); - thrust::device_vector d_stencil = thrusttest::random_samples(n); + thrust::host_vector h_stencil = unittest::random_samples(n); + thrust::device_vector d_stencil = unittest::random_samples(n); thrust::host_vector h_result(n); thrust::device_vector d_result(n); diff --git a/testing/count.cu b/testing/count.cu index 1ce199a32..800ae9fcd 100644 --- a/testing/count.cu +++ b/testing/count.cu @@ -1,4 +1,4 @@ -#include +#include #include template @@ -18,7 +18,7 @@ DECLARE_VECTOR_UNITTEST(TestCountSimple); template void TestCount(const size_t n) { - thrust::host_vector h_data = thrusttest::random_samples(n); + thrust::host_vector h_data = unittest::random_samples(n); thrust::device_vector d_data = h_data; size_t cpu_result = thrust::count(h_data.begin(), h_data.end(), T(5)); @@ -53,7 +53,7 @@ DECLARE_VECTOR_UNITTEST(TestCountIfSimple); template void TestCountIf(const size_t n) { - thrust::host_vector h_data = thrusttest::random_samples(n); + thrust::host_vector h_data = unittest::random_samples(n); thrust::device_vector d_data = h_data; size_t cpu_result = thrust::count_if(h_data.begin(), h_data.end(), greater_than_five()); diff --git a/testing/counting_iterator.cu b/testing/counting_iterator.cu index 075065ded..44184eeb8 100644 --- a/testing/counting_iterator.cu +++ b/testing/counting_iterator.cu @@ -1,4 +1,4 @@ -#include +#include #include #include #include @@ -107,7 +107,7 @@ void TestCountingIteratorLowerBound(void) size_t n = 10000; const size_t M = 100; - thrust::host_vector h_data = thrusttest::random_integers(n); + thrust::host_vector h_data = unittest::random_integers(n); for(unsigned int i = 0; i < n; ++i) h_data[i] %= M; diff --git a/testing/cuda/merge_sort.cu b/testing/cuda/merge_sort.cu index 0603abaf7..756d1cf4b 100644 --- a/testing/cuda/merge_sort.cu +++ b/testing/cuda/merge_sort.cu @@ -1,4 +1,4 @@ -#include +#include #include #include @@ -175,7 +175,7 @@ void TestMergeSortAscendingKey(const size_t n) typedef int T; #endif - thrust::host_vector h_data = thrusttest::random_integers(n); + thrust::host_vector h_data = unittest::random_integers(n); thrust::device_vector d_data = h_data; thrust::sort(h_data.begin(), h_data.end(), thrust::less()); @@ -196,7 +196,7 @@ void TestMergeSortDescendingKey(void) { const size_t n = 10027; - thrust::host_vector h_data = thrusttest::random_integers(n); + thrust::host_vector h_data = unittest::random_integers(n); thrust::device_vector d_data = h_data; thrust::sort(h_data.begin(), h_data.end(), thrust::greater()); @@ -210,10 +210,10 @@ DECLARE_UNITTEST(TestMergeSortDescendingKey); template void TestMergeSortAscendingKeyValue(const size_t n) { - thrust::host_vector h_keys = thrusttest::random_integers(n); + thrust::host_vector h_keys = unittest::random_integers(n); thrust::device_vector d_keys = h_keys; - thrust::host_vector h_values = thrusttest::random_integers(n); + thrust::host_vector h_values = unittest::random_integers(n); thrust::device_vector d_values = h_values; thrust::sort_by_key(h_keys.begin(), h_keys.end(), h_values.begin(), thrust::less()); @@ -229,10 +229,10 @@ void TestMergeSortDescendingKeyValue(void) { const size_t n = 10027; - thrust::host_vector h_keys = thrusttest::random_integers(n); + thrust::host_vector h_keys = unittest::random_integers(n); thrust::device_vector d_keys = h_keys; - thrust::host_vector h_values = thrusttest::random_integers(n); + thrust::host_vector h_values = unittest::random_integers(n); thrust::device_vector d_values = h_values; thrust::sort_by_key(h_keys.begin(), h_keys.end(), h_values.begin(), thrust::greater()); diff --git a/testing/cuda/pinned_allocator.cu b/testing/cuda/pinned_allocator.cu index caf55300e..f4bc6dfb2 100644 --- a/testing/cuda/pinned_allocator.cu +++ b/testing/cuda/pinned_allocator.cu @@ -1,4 +1,4 @@ -#include +#include #include #include #include @@ -8,7 +8,7 @@ void TestPinnedAllocatorSimple(const size_t n) { typedef thrust::host_vector > Vector; - Vector h_input = thrusttest::random_integers(n); + Vector h_input = unittest::random_integers(n); Vector h_output(n); thrust::copy(h_input.begin(), h_input.end(), h_output.begin()); diff --git a/testing/cuda/radix_sort.cu b/testing/cuda/radix_sort.cu index 166716024..5357cdcc4 100644 --- a/testing/cuda/radix_sort.cu +++ b/testing/cuda/radix_sort.cu @@ -1,4 +1,4 @@ -#include +#include #include #include #include @@ -8,7 +8,7 @@ #if THRUST_DEVICE_BACKEND == THRUST_DEVICE_BACKEND_CUDA -using namespace thrusttest; +using namespace unittest; template void InitializeSimpleKeyRadixSortTest(Vector& unsorted_keys, Vector& sorted_keys) @@ -125,7 +125,7 @@ VectorUnitTest h_keys = thrusttest::random_integers(n); + thrust::host_vector h_keys = unittest::random_integers(n); thrust::device_vector d_keys = h_keys; thrust::stable_sort(h_keys.begin(), h_keys.end()); @@ -160,7 +160,7 @@ struct TestRadixSortByKey { void operator()(const size_t n) { - thrust::host_vector h_keys = thrusttest::random_integers(n); + thrust::host_vector h_keys = unittest::random_integers(n); thrust::device_vector d_keys = h_keys; thrust::host_vector h_values(n); @@ -183,7 +183,7 @@ struct TestRadixSortByKeyShortValues { void operator()(const size_t n) { - thrust::host_vector h_keys = thrusttest::random_integers(n); + thrust::host_vector h_keys = unittest::random_integers(n); thrust::device_vector d_keys = h_keys; thrust::host_vector h_values(n); @@ -205,7 +205,7 @@ struct TestRadixSortByKeyFloatValues { void operator()(const size_t n) { - thrust::host_vector h_keys = thrusttest::random_integers(n); + thrust::host_vector h_keys = unittest::random_integers(n); thrust::device_vector d_keys = h_keys; thrust::host_vector h_values(n); @@ -234,7 +234,7 @@ struct TestRadixSortVariableBits KNOWN_FAILURE; #else for(size_t num_bits = 0; num_bits < 8 * sizeof(T); num_bits += 7){ - thrust::host_vector h_keys = thrusttest::random_integers(n); + thrust::host_vector h_keys = unittest::random_integers(n); size_t mask = (1 << num_bits) - 1; for(size_t i = 0; i < n; i++) @@ -259,7 +259,7 @@ struct TestRadixSortByKeyVariableBits void operator()(const size_t n) { for(size_t num_bits = 0; num_bits < 8 * sizeof(T); num_bits += 7){ - thrust::host_vector h_keys = thrusttest::random_integers(n); + thrust::host_vector h_keys = unittest::random_integers(n); const T mask = (1 << num_bits) - 1; for(size_t i = 0; i < n; i++) @@ -287,7 +287,7 @@ VariableUnitTest TestRadixSortByK //{ // typedef unsigned long long T; // const size_t n = (1 << 20) + 3; -// thrust::host_vector h_keys = thrusttest::random_integers(n); +// thrust::host_vector h_keys = unittest::random_integers(n); // thrust::device_vector d_keys = h_keys; // // thrust::detail::device::cuda::detail::stable_radix_sort(h_keys.begin(), h_keys.end()); diff --git a/testing/dereference.cu b/testing/dereference.cu index 467d2ac1b..b1b70abaa 100644 --- a/testing/dereference.cu +++ b/testing/dereference.cu @@ -1,4 +1,4 @@ -#include +#include #include #include @@ -30,7 +30,7 @@ void simple_copy(Iterator1 first1, Iterator1 last1, Iterator2 first2) void TestDeviceDereferenceDeviceVectorIterator(void) { - thrust::device_vector input = thrusttest::random_integers(100); + thrust::device_vector input = unittest::random_integers(100); thrust::device_vector output(input.size(), 0); simple_copy(input.begin(), input.end(), output.begin()); @@ -41,7 +41,7 @@ DECLARE_UNITTEST(TestDeviceDereferenceDeviceVectorIterator); void TestDeviceDereferenceDevicePtr(void) { - thrust::device_vector input = thrusttest::random_integers(100); + thrust::device_vector input = unittest::random_integers(100); thrust::device_vector output(input.size(), 0); thrust::device_ptr _first1 = &input[0]; @@ -56,7 +56,7 @@ DECLARE_UNITTEST(TestDeviceDereferenceDevicePtr); void TestDeviceDereferenceTransformIterator(void) { - thrust::device_vector input = thrusttest::random_integers(100); + thrust::device_vector input = unittest::random_integers(100); thrust::device_vector output(input.size(), 0); simple_copy(thrust::make_transform_iterator(input.begin(), thrust::identity()), diff --git a/testing/device_delete.cu b/testing/device_delete.cu index 26be9bd1c..b32d4b27b 100644 --- a/testing/device_delete.cu +++ b/testing/device_delete.cu @@ -1,4 +1,4 @@ -#include +#include #include #include #include diff --git a/testing/device_ptr.cu b/testing/device_ptr.cu index 8d2a48a79..ab3d5e3d1 100644 --- a/testing/device_ptr.cu +++ b/testing/device_ptr.cu @@ -1,4 +1,4 @@ -#include +#include #include #include diff --git a/testing/device_reference.cu b/testing/device_reference.cu index 8e17f1dcc..a1cd3d637 100644 --- a/testing/device_reference.cu +++ b/testing/device_reference.cu @@ -1,4 +1,4 @@ -#include +#include #include #include diff --git a/testing/distance.cu b/testing/distance.cu index e4d9b24ef..6e179e496 100644 --- a/testing/distance.cu +++ b/testing/distance.cu @@ -1,4 +1,4 @@ -#include +#include #include // TODO expand this with other iterator types (forward, bidirectional, etc.) diff --git a/testing/equal.cu b/testing/equal.cu index 1d3e45e21..72c24d15c 100644 --- a/testing/equal.cu +++ b/testing/equal.cu @@ -1,4 +1,4 @@ -#include +#include #include #include @@ -30,8 +30,8 @@ DECLARE_VECTOR_UNITTEST(TestEqualSimple); template void TestEqual(const size_t n) { - thrust::host_vector h_data1 = thrusttest::random_samples(n); - thrust::host_vector h_data2 = thrusttest::random_samples(n); + thrust::host_vector h_data1 = unittest::random_samples(n); + thrust::host_vector h_data2 = unittest::random_samples(n); thrust::device_vector d_data1 = h_data1; thrust::device_vector d_data2 = h_data2; diff --git a/testing/fill.cu b/testing/fill.cu index 32f432495..674cfda9d 100644 --- a/testing/fill.cu +++ b/testing/fill.cu @@ -1,4 +1,4 @@ -#include +#include #include @@ -72,7 +72,7 @@ DECLARE_VECTOR_UNITTEST(TestFillMixedTypes); template void TestFill(size_t n) { - thrust::host_vector h_data = thrusttest::random_integers(n); + thrust::host_vector h_data = unittest::random_integers(n); thrust::device_vector d_data = h_data; thrust::fill(h_data.begin() + std::min((size_t)1, n), h_data.begin() + std::min((size_t)3, n), (T) 0); diff --git a/testing/find.cu b/testing/find.cu index ed03c1da4..1d424521d 100644 --- a/testing/find.cu +++ b/testing/find.cu @@ -1,4 +1,4 @@ -#include +#include #include template diff --git a/testing/for_each.cu b/testing/for_each.cu index 81a3f87cf..8b88762aa 100644 --- a/testing/for_each.cu +++ b/testing/for_each.cu @@ -1,4 +1,4 @@ -#include +#include #include #include @@ -53,7 +53,7 @@ void TestForEach(const size_t n) { const size_t output_size = std::min((size_t) 10, 2 * n); - thrust::host_vector h_input = thrusttest::random_integers(n); + thrust::host_vector h_input = unittest::random_integers(n); for(size_t i = 0; i < n; i++) h_input[i] = ((size_t) h_input[i]) % output_size; diff --git a/testing/functional.cu b/testing/functional.cu index 5e3056860..9bd9a567a 100644 --- a/testing/functional.cu +++ b/testing/functional.cu @@ -1,4 +1,4 @@ -#include +#include #include #include @@ -13,7 +13,7 @@ void TestUnaryFunctional(void) typedef typename InputVector::value_type InputType; typedef typename OutputVector::value_type OutputType; - thrust::host_vector std_input = thrusttest::random_samples(NUM_SAMPLES); + thrust::host_vector std_input = unittest::random_samples(NUM_SAMPLES); thrust::host_vector std_output(NUM_SAMPLES); InputVector input = std_input; @@ -31,8 +31,8 @@ void TestBinaryFunctional(void) typedef typename InputVector::value_type InputType; typedef typename OutputVector::value_type OutputType; - thrust::host_vector std_input1 = thrusttest::random_samples(NUM_SAMPLES); - thrust::host_vector std_input2 = thrusttest::random_samples(NUM_SAMPLES); + thrust::host_vector std_input1 = unittest::random_samples(NUM_SAMPLES); + thrust::host_vector std_input2 = unittest::random_samples(NUM_SAMPLES); thrust::host_vector std_output(NUM_SAMPLES); // Replace zeros to avoid divide by zero exceptions diff --git a/testing/gather.cu b/testing/gather.cu index eba34b220..38e417dfc 100644 --- a/testing/gather.cu +++ b/testing/gather.cu @@ -1,4 +1,4 @@ -#include +#include #include #include @@ -87,11 +87,11 @@ void TestGather(const size_t n) const size_t source_size = std::min((size_t) 10, 2 * n); // source vectors to gather from - thrust::host_vector h_source = thrusttest::random_samples(source_size); + thrust::host_vector h_source = unittest::random_samples(source_size); thrust::device_vector d_source = h_source; // gather indices - thrust::host_vector h_map = thrusttest::random_integers(n); + thrust::host_vector h_map = unittest::random_integers(n); for(size_t i = 0; i < n; i++) h_map[i] = h_map[i] % source_size; @@ -150,11 +150,11 @@ void TestGatherIf(const size_t n) const size_t source_size = std::min((size_t) 10, 2 * n); // source vectors to gather from - thrust::host_vector h_source = thrusttest::random_samples(source_size); + thrust::host_vector h_source = unittest::random_samples(source_size); thrust::device_vector d_source = h_source; // gather indices - thrust::host_vector h_map = thrusttest::random_integers(n); + thrust::host_vector h_map = unittest::random_integers(n); for(size_t i = 0; i < n; i++) h_map[i] = h_map[i] % source_size; @@ -162,7 +162,7 @@ void TestGatherIf(const size_t n) thrust::device_vector d_map = h_map; // gather stencil - thrust::host_vector h_stencil = thrusttest::random_integers(n); + thrust::host_vector h_stencil = unittest::random_integers(n); for(size_t i = 0; i < n; i++) h_stencil[i] = h_stencil[i] % 2; @@ -354,11 +354,11 @@ void TestNextGather(const size_t n) const size_t source_size = std::min((size_t) 10, 2 * n); // source vectors to gather from - thrust::host_vector h_source = thrusttest::random_samples(source_size); + thrust::host_vector h_source = unittest::random_samples(source_size); thrust::device_vector d_source = h_source; // gather indices - thrust::host_vector h_map = thrusttest::random_integers(n); + thrust::host_vector h_map = unittest::random_integers(n); for(size_t i = 0; i < n; i++) h_map[i] = h_map[i] % source_size; @@ -410,11 +410,11 @@ void TestNextGatherIf(const size_t n) const size_t source_size = std::min((size_t) 10, 2 * n); // source vectors to gather from - thrust::host_vector h_source = thrusttest::random_samples(source_size); + thrust::host_vector h_source = unittest::random_samples(source_size); thrust::device_vector d_source = h_source; // gather indices - thrust::host_vector h_map = thrusttest::random_integers(n); + thrust::host_vector h_map = unittest::random_integers(n); for(size_t i = 0; i < n; i++) h_map[i] = h_map[i] % source_size; @@ -422,7 +422,7 @@ void TestNextGatherIf(const size_t n) thrust::device_vector d_map = h_map; // gather stencil - thrust::host_vector h_stencil = thrusttest::random_integers(n); + thrust::host_vector h_stencil = unittest::random_integers(n); for(size_t i = 0; i < n; i++) h_stencil[i] = h_stencil[i] % 2; diff --git a/testing/generate.cu b/testing/generate.cu index 3b77ee985..129ca79db 100644 --- a/testing/generate.cu +++ b/testing/generate.cu @@ -1,4 +1,4 @@ -#include +#include #include template diff --git a/testing/inner_product.cu b/testing/inner_product.cu index 7884f64e5..94b8b264a 100644 --- a/testing/inner_product.cu +++ b/testing/inner_product.cu @@ -1,4 +1,4 @@ -#include +#include #include template @@ -38,8 +38,8 @@ DECLARE_VECTOR_UNITTEST(TestInnerProductWithOperator); template void TestInnerProduct(const size_t n) { - thrust::host_vector h_v1 = thrusttest::random_integers(n); - thrust::host_vector h_v2 = thrusttest::random_integers(n); + thrust::host_vector h_v1 = unittest::random_integers(n); + thrust::host_vector h_v2 = unittest::random_integers(n); thrust::device_vector d_v1 = h_v1; thrust::device_vector d_v2 = h_v2; diff --git a/testing/is_sorted.cu b/testing/is_sorted.cu index 750045270..0efaae494 100644 --- a/testing/is_sorted.cu +++ b/testing/is_sorted.cu @@ -1,4 +1,4 @@ -#include +#include #include #include @@ -41,7 +41,7 @@ void TestIsSorted(void) const size_t n = (1 << 16) + 13; - Vector v = thrusttest::random_integers(n); + Vector v = unittest::random_integers(n); v[0] = 1; v[1] = 0; diff --git a/testing/logical.cu b/testing/logical.cu index 769324cc1..7a0f2c34a 100644 --- a/testing/logical.cu +++ b/testing/logical.cu @@ -1,4 +1,4 @@ -#include +#include #include #include diff --git a/testing/max_element.cu b/testing/max_element.cu index 4c1e1bfbb..b74d11855 100644 --- a/testing/max_element.cu +++ b/testing/max_element.cu @@ -1,4 +1,4 @@ -#include +#include #include template @@ -25,7 +25,7 @@ DECLARE_VECTOR_UNITTEST(TestMaxElementSimple); template void TestMaxElement(const size_t n) { - thrust::host_vector h_data = thrusttest::random_samples(n); + thrust::host_vector h_data = unittest::random_samples(n); thrust::device_vector d_data = h_data; typename thrust::host_vector::iterator h_max = thrust::max_element(h_data.begin(), h_data.end()); diff --git a/testing/metaprogamming.cu b/testing/metaprogamming.cu index 21e23e917..53a7d8994 100644 --- a/testing/metaprogamming.cu +++ b/testing/metaprogamming.cu @@ -1,4 +1,4 @@ -#include +#include #include void TestLog2(void) diff --git a/testing/min_element.cu b/testing/min_element.cu index 76f90084b..3a9a6b81f 100644 --- a/testing/min_element.cu +++ b/testing/min_element.cu @@ -1,4 +1,4 @@ -#include +#include #include template @@ -25,7 +25,7 @@ DECLARE_VECTOR_UNITTEST(TestMinElementSimple); template void TestMinElement(const size_t n) { - thrust::host_vector h_data = thrusttest::random_samples(n); + thrust::host_vector h_data = unittest::random_samples(n); thrust::device_vector d_data = h_data; typename thrust::host_vector::iterator h_min = thrust::min_element(h_data.begin(), h_data.end()); diff --git a/testing/minmax_element.cu b/testing/minmax_element.cu index 4268d1a47..bb3a8a712 100644 --- a/testing/minmax_element.cu +++ b/testing/minmax_element.cu @@ -1,4 +1,4 @@ -#include +#include #include template @@ -24,7 +24,7 @@ DECLARE_VECTOR_UNITTEST(TestMinMaxElementSimple); template void TestMinMaxElement(const size_t n) { - thrust::host_vector h_data = thrusttest::random_samples(n); + thrust::host_vector h_data = unittest::random_samples(n); thrust::device_vector d_data = h_data; typename thrust::host_vector::iterator h_min; diff --git a/testing/mismatch.cu b/testing/mismatch.cu index c6f6e2d37..189933079 100644 --- a/testing/mismatch.cu +++ b/testing/mismatch.cu @@ -1,4 +1,4 @@ -#include +#include #include template diff --git a/testing/pair.cu b/testing/pair.cu index 842afc379..ed6a7f173 100644 --- a/testing/pair.cu +++ b/testing/pair.cu @@ -1,4 +1,4 @@ -#include +#include #include #include #include @@ -221,8 +221,8 @@ template { typedef thrust::pair P; - thrust::host_vector h_p1 = thrusttest::random_integers(n); - thrust::host_vector h_p2 = thrusttest::random_integers(n); + thrust::host_vector h_p1 = unittest::random_integers(n); + thrust::host_vector h_p2 = unittest::random_integers(n); thrust::host_vector

h_result(n); thrust::device_vector d_p1 = h_p1; @@ -259,8 +259,8 @@ template { typedef thrust::pair P; - thrust::host_vector h_p1 = thrusttest::random_integers(n); - thrust::host_vector h_p2 = thrusttest::random_integers(n); + thrust::host_vector h_p1 = unittest::random_integers(n); + thrust::host_vector h_p2 = unittest::random_integers(n); thrust::host_vector

h_pairs(n); // zip up pairs on the host @@ -291,8 +291,8 @@ template { typedef thrust::pair P; - thrust::host_vector h_p1 = thrusttest::random_integers(n); - thrust::host_vector h_p2 = thrusttest::random_integers(n); + thrust::host_vector h_p1 = unittest::random_integers(n); + thrust::host_vector h_p2 = unittest::random_integers(n); thrust::host_vector

h_pairs(n); thrust::host_vector

h_output(n); @@ -334,8 +334,8 @@ template { typedef thrust::pair P; - thrust::host_vector h_p1 = thrusttest::random_integers(n); - thrust::host_vector h_p2 = thrusttest::random_integers(n); + thrust::host_vector h_p1 = unittest::random_integers(n); + thrust::host_vector h_p2 = unittest::random_integers(n); thrust::host_vector

h_pairs(n); // zip up pairs on the host @@ -369,8 +369,8 @@ template { typedef thrust::pair P; - thrust::host_vector h_p1 = thrusttest::random_integers(n); - thrust::host_vector h_p2 = thrusttest::random_integers(n); + thrust::host_vector h_p1 = unittest::random_integers(n); + thrust::host_vector h_p2 = unittest::random_integers(n); thrust::host_vector

h_pairs(n); // zip up pairs on the host @@ -398,8 +398,8 @@ template typedef thrust::pair P; // host arrays - thrust::host_vector h_p1 = thrusttest::random_integers(n); - thrust::host_vector h_p2 = thrusttest::random_integers(n); + thrust::host_vector h_p1 = unittest::random_integers(n); + thrust::host_vector h_p2 = unittest::random_integers(n); thrust::host_vector

h_pairs(n); thrust::host_vector h_values(n); @@ -430,7 +430,7 @@ struct TestPairGet { void operator()(void) { - thrust::host_vector data = thrusttest::random_integers(2); + thrust::host_vector data = unittest::random_integers(2); thrust::pair p(data[0], data[1]); diff --git a/testing/partition.cu b/testing/partition.cu index a68fa2f77..0187b200a 100644 --- a/testing/partition.cu +++ b/testing/partition.cu @@ -1,4 +1,4 @@ -#include +#include #include #include @@ -123,7 +123,7 @@ DECLARE_VECTOR_UNITTEST(TestStablePartitionCopySimple); template void TestPartition(const size_t n) { - thrust::host_vector h_data = thrusttest::random_integers(n); + thrust::host_vector h_data = unittest::random_integers(n); thrust::device_vector d_data = h_data; typename thrust::host_vector::iterator h_iter = thrust::partition(h_data.begin(), h_data.end(), is_even()); @@ -141,7 +141,7 @@ DECLARE_VARIABLE_UNITTEST(TestPartition); template void TestPartitionCopy(const size_t n) { - thrust::host_vector h_data = thrusttest::random_integers(n); + thrust::host_vector h_data = unittest::random_integers(n); thrust::device_vector d_data = h_data; thrust::host_vector h_result(n); @@ -162,7 +162,7 @@ DECLARE_VARIABLE_UNITTEST(TestPartitionCopy); template void TestStablePartition(const size_t n) { - thrust::host_vector h_data = thrusttest::random_integers(n); + thrust::host_vector h_data = unittest::random_integers(n); thrust::device_vector d_data = h_data; typename thrust::host_vector::iterator h_iter = thrust::stable_partition(h_data.begin(), h_data.end(), is_even()); @@ -177,7 +177,7 @@ DECLARE_VARIABLE_UNITTEST(TestStablePartition); template void TestStablePartitionCopy(const size_t n) { - thrust::host_vector h_data = thrusttest::random_integers(n); + thrust::host_vector h_data = unittest::random_integers(n); thrust::device_vector d_data = h_data; thrust::host_vector h_result(n); diff --git a/testing/permutation_iterator.cu b/testing/permutation_iterator.cu index 4ce2d849f..85003b9c1 100644 --- a/testing/permutation_iterator.cu +++ b/testing/permutation_iterator.cu @@ -1,4 +1,4 @@ -#include +#include #include #include diff --git a/testing/random.cu b/testing/random.cu index 1ca724626..f9678ba8e 100644 --- a/testing/random.cu +++ b/testing/random.cu @@ -1,4 +1,4 @@ -#include +#include #include #include #include diff --git a/testing/reduce.cu b/testing/reduce.cu index 9c9b106a4..2c4fca585 100644 --- a/testing/reduce.cu +++ b/testing/reduce.cu @@ -1,4 +1,4 @@ -#include +#include #include template @@ -28,7 +28,7 @@ DECLARE_VECTOR_UNITTEST(TestReduceSimple); template void TestReduce(const size_t n) { - thrust::host_vector h_data = thrusttest::random_integers(n); + thrust::host_vector h_data = unittest::random_integers(n); thrust::device_vector d_data = h_data; T init = 13; @@ -79,7 +79,7 @@ DECLARE_UNITTEST(TestReduceMixedTypesDevice); template void TestReduceWithOperator(const size_t n) { - thrust::host_vector h_data = thrusttest::random_integers(n); + thrust::host_vector h_data = unittest::random_integers(n); thrust::device_vector d_data = h_data; T init = 0; @@ -279,8 +279,8 @@ struct TestReduceByKey { typedef unsigned int V; // ValueType - thrust::host_vector h_keys = thrusttest::random_integers(n); - thrust::host_vector h_vals = thrusttest::random_integers(n); + thrust::host_vector h_keys = unittest::random_integers(n); + thrust::host_vector h_vals = unittest::random_integers(n); thrust::device_vector d_keys = h_keys; thrust::device_vector d_vals = h_vals; diff --git a/testing/remove.cu b/testing/remove.cu index 21a293f9a..854289804 100644 --- a/testing/remove.cu +++ b/testing/remove.cu @@ -1,4 +1,4 @@ -#include +#include #include #include @@ -194,7 +194,7 @@ DECLARE_VECTOR_UNITTEST(TestRemoveCopyIfStencilSimple); template void TestRemoveIf(const size_t n) { - thrust::host_vector h_data = thrusttest::random_samples(n); + thrust::host_vector h_data = unittest::random_samples(n); thrust::device_vector d_data = h_data; is_true_remove pred; @@ -215,7 +215,7 @@ DECLARE_VARIABLE_UNITTEST(TestRemoveIf); template void TestRemove(const size_t n) { - thrust::host_vector h_data = thrusttest::random_samples(n); + thrust::host_vector h_data = unittest::random_samples(n); thrust::device_vector d_data = h_data; T remove_me = 0; @@ -235,7 +235,7 @@ DECLARE_VARIABLE_UNITTEST(TestRemove); template void TestRemoveCopyIf(const size_t n) { - thrust::host_vector h_data = thrusttest::random_samples(n); + thrust::host_vector h_data = unittest::random_samples(n); thrust::device_vector d_data = h_data; thrust::host_vector h_result(n); @@ -257,10 +257,10 @@ DECLARE_VARIABLE_UNITTEST(TestRemoveCopyIf); template void TestRemoveIfStencil(const size_t n) { - thrust::host_vector h_data = thrusttest::random_samples(n); + thrust::host_vector h_data = unittest::random_samples(n); thrust::device_vector d_data = h_data; - thrust::host_vector h_stencil = thrusttest::random_samples(n); + thrust::host_vector h_stencil = unittest::random_samples(n); thrust::device_vector d_stencil = h_stencil; is_true_remove pred; @@ -279,7 +279,7 @@ DECLARE_VARIABLE_UNITTEST(TestRemoveIfStencil); template void TestRemoveCopy(const size_t n) { - thrust::host_vector h_data = thrusttest::random_samples(n); + thrust::host_vector h_data = unittest::random_samples(n); thrust::device_vector d_data = h_data; thrust::host_vector h_result(n); @@ -302,10 +302,10 @@ DECLARE_VARIABLE_UNITTEST(TestRemoveCopy); template void TestRemoveCopyIfStencil(const size_t n) { - thrust::host_vector h_data = thrusttest::random_samples(n); + thrust::host_vector h_data = unittest::random_samples(n); thrust::device_vector d_data = h_data; - thrust::host_vector h_stencil = thrusttest::random_samples(n); + thrust::host_vector h_stencil = unittest::random_samples(n); thrust::device_vector d_stencil = h_stencil; thrust::host_vector h_output(n); diff --git a/testing/replace.cu b/testing/replace.cu index 3b793297b..5012cbb4b 100644 --- a/testing/replace.cu +++ b/testing/replace.cu @@ -1,4 +1,4 @@ -#include +#include #include template @@ -31,7 +31,7 @@ DECLARE_VECTOR_UNITTEST(TestReplaceSimple); template void TestReplace(const size_t n) { - thrust::host_vector h_data = thrusttest::random_samples(n); + thrust::host_vector h_data = unittest::random_samples(n); thrust::device_vector d_data = h_data; T old_value = 0; @@ -77,7 +77,7 @@ DECLARE_VECTOR_UNITTEST(TestReplaceCopySimple); template void TestReplaceCopy(const size_t n) { - thrust::host_vector h_data = thrusttest::random_samples(n); + thrust::host_vector h_data = unittest::random_samples(n); thrust::device_vector d_data = h_data; T old_value = 0; @@ -164,7 +164,7 @@ DECLARE_VECTOR_UNITTEST(TestReplaceIfStencilSimple); template void TestReplaceIf(const size_t n) { - thrust::host_vector h_data = thrusttest::random_samples(n); + thrust::host_vector h_data = unittest::random_samples(n); thrust::device_vector d_data = h_data; thrust::replace_if(h_data.begin(), h_data.end(), less_than_five(), (T) 0); @@ -178,10 +178,10 @@ DECLARE_VARIABLE_UNITTEST(TestReplaceIf); template void TestReplaceIfStencil(const size_t n) { - thrust::host_vector h_data = thrusttest::random_samples(n); + thrust::host_vector h_data = unittest::random_samples(n); thrust::device_vector d_data = h_data; - thrust::host_vector h_stencil = thrusttest::random_samples(n); + thrust::host_vector h_stencil = unittest::random_samples(n); thrust::device_vector d_stencil = h_stencil; thrust::replace_if(h_data.begin(), h_data.end(), h_stencil.begin(), less_than_five(), (T) 0); @@ -258,7 +258,7 @@ DECLARE_VECTOR_UNITTEST(TestReplaceCopyIfStencilSimple); template void TestReplaceCopyIf(const size_t n) { - thrust::host_vector h_data = thrusttest::random_samples(n); + thrust::host_vector h_data = unittest::random_samples(n); thrust::device_vector d_data = h_data; thrust::host_vector h_dest(n); @@ -275,10 +275,10 @@ DECLARE_VARIABLE_UNITTEST(TestReplaceCopyIf); template void TestReplaceCopyIfStencil(const size_t n) { - thrust::host_vector h_data = thrusttest::random_samples(n); + thrust::host_vector h_data = unittest::random_samples(n); thrust::device_vector d_data = h_data; - thrust::host_vector h_stencil = thrusttest::random_samples(n); + thrust::host_vector h_stencil = unittest::random_samples(n); thrust::device_vector d_stencil = h_stencil; thrust::host_vector h_dest(n); diff --git a/testing/reverse_iterator.cu b/testing/reverse_iterator.cu index 0988b83a7..1571456f1 100644 --- a/testing/reverse_iterator.cu +++ b/testing/reverse_iterator.cu @@ -1,4 +1,4 @@ -#include +#include #include #include #include @@ -114,7 +114,7 @@ struct TestReverseIteratorExclusiveScan { void operator()(const size_t n) { - thrust::host_vector h_data = thrusttest::random_samples(n); + thrust::host_vector h_data = unittest::random_samples(n); thrust::device_vector d_data = h_data; diff --git a/testing/scan.cu b/testing/scan.cu index c2b70ed85..0e79ed43b 100644 --- a/testing/scan.cu +++ b/testing/scan.cu @@ -1,4 +1,4 @@ -#include +#include #include #include @@ -81,7 +81,7 @@ void TestInclusiveScan32(void) typedef int T; size_t n = 32; - thrust::host_vector h_input = thrusttest::random_integers(n); + thrust::host_vector h_input = unittest::random_integers(n); thrust::device_vector d_input = h_input; thrust::host_vector h_output(n); @@ -101,7 +101,7 @@ void TestExclusiveScan32(void) size_t n = 32; T init = 13; - thrust::host_vector h_input = thrusttest::random_integers(n); + thrust::host_vector h_input = unittest::random_integers(n); thrust::device_vector d_input = h_input; thrust::host_vector h_output(n); @@ -193,7 +193,7 @@ struct TestScanWithOperator { void operator()(const size_t n) { - thrust::host_vector h_input = thrusttest::random_integers(n); + thrust::host_vector h_input = unittest::random_integers(n); thrust::device_vector d_input = h_input; thrust::host_vector h_output(n); @@ -216,7 +216,7 @@ struct TestScan { void operator()(const size_t n) { - thrust::host_vector h_input = thrusttest::random_integers(n); + thrust::host_vector h_input = unittest::random_integers(n); thrust::device_vector d_input = h_input; thrust::host_vector h_output(n); @@ -255,7 +255,7 @@ void TestScanMixedTypes(void) { const unsigned int n = 113; - thrust::host_vector h_input = thrusttest::random_integers(n); + thrust::host_vector h_input = unittest::random_integers(n); for(size_t i = 0; i < n; i++) h_input[i] %= 10; thrust::device_vector d_input = h_input; @@ -328,15 +328,14 @@ void TestScanWithLargeTypes(void) // XXX the following fail with "too many resources requested for launch" KNOWN_FAILURE - _TestScanWithLargeTypes(); - _TestScanWithLargeTypes(); - _TestScanWithLargeTypes(); -#endif - + //_TestScanWithLargeTypes(); + //_TestScanWithLargeTypes(); + //_TestScanWithLargeTypes(); //_TestScanWithLargeTypes(); //_TestScanWithLargeTypes(); //_TestScanWithLargeTypes(); //_TestScanWithLargeTypes(); +#endif } DECLARE_UNITTEST(TestScanWithLargeTypes); diff --git a/testing/scatter.cu b/testing/scatter.cu index 4a283ad69..5a522683a 100644 --- a/testing/scatter.cu +++ b/testing/scatter.cu @@ -1,4 +1,4 @@ -#include +#include #include #include #include @@ -112,7 +112,7 @@ void TestScatter(const size_t n) thrust::host_vector h_input(n, (T) 1); thrust::device_vector d_input(n, (T) 1); - thrust::host_vector h_map = thrusttest::random_integers(n); + thrust::host_vector h_map = unittest::random_integers(n); for(size_t i = 0; i < n; i++) h_map[i] = h_map[i] % output_size; @@ -174,7 +174,7 @@ void TestScatterIf(const size_t n) thrust::host_vector h_input(n, (T) 1); thrust::device_vector d_input(n, (T) 1); - thrust::host_vector h_map = thrusttest::random_integers(n); + thrust::host_vector h_map = unittest::random_integers(n); for(size_t i = 0; i < n; i++) h_map[i] = h_map[i] % output_size; diff --git a/testing/segmented_scan.cu b/testing/segmented_scan.cu index d695cc63d..504d7209d 100644 --- a/testing/segmented_scan.cu +++ b/testing/segmented_scan.cu @@ -1,4 +1,4 @@ -#include +#include #include #include #include @@ -235,7 +235,7 @@ DECLARE_VECTOR_UNITTEST(TestSegmentedScanReusedKeys); template void TestSegmentedScan(const size_t n) { - thrust::host_vector h_input = thrusttest::random_integers(n); + thrust::host_vector h_input = unittest::random_integers(n); for(size_t i = 0; i < n; i++) h_input[i] = i % 10; thrust::device_vector d_input = h_input; @@ -286,7 +286,7 @@ void TestSegmentedScanMixedTypes(void) { const unsigned int n = 113; - thrust::host_vector h_input = thrusttest::random_integers(n); + thrust::host_vector h_input = unittest::random_integers(n); for(size_t i = 0; i < n; i++) h_input[i] %= 10; thrust::device_vector d_input = h_input; @@ -334,9 +334,9 @@ void TestSegmentedScanLargeInput() const unsigned int N = 1 << 20; const unsigned int K = 100; - thrust::host_vector input_sizes = thrusttest::random_integers(10); + thrust::host_vector input_sizes = unittest::random_integers(10); - thrust::host_vector h_input = thrusttest::random_integers(N); + thrust::host_vector h_input = unittest::random_integers(N); thrust::device_vector d_input = h_input; thrust::host_vector h_output(N, 0); diff --git a/testing/sequence.cu b/testing/sequence.cu index 0b754ac4a..32afe34a0 100644 --- a/testing/sequence.cu +++ b/testing/sequence.cu @@ -1,4 +1,4 @@ -#include +#include #include diff --git a/testing/set_intersection.cu b/testing/set_intersection.cu index 8daca01cc..65ae1f867 100644 --- a/testing/set_intersection.cu +++ b/testing/set_intersection.cu @@ -1,4 +1,4 @@ -#include +#include #include #include #include @@ -33,7 +33,7 @@ DECLARE_VECTOR_UNITTEST(TestSetIntersectionSimple); template void TestSetIntersection(const size_t n) { - thrust::host_vector temp = thrusttest::random_integers(2 * n); + thrust::host_vector temp = unittest::random_integers(2 * n); thrust::host_vector h_a(temp.begin(), temp.begin() + n); thrust::host_vector h_b(temp.begin() + n, temp.end()); @@ -95,7 +95,7 @@ DECLARE_VECTOR_UNITTEST(TestSetIntersectionAscendingSimple); template void TestSetIntersectionAscending(const size_t n) { - thrust::host_vector temp = thrusttest::random_integers(2 * n); + thrust::host_vector temp = unittest::random_integers(2 * n); thrust::host_vector h_a(temp.begin(), temp.begin() + n); thrust::host_vector h_b(temp.begin() + n, temp.end()); @@ -132,7 +132,7 @@ DECLARE_VARIABLE_UNITTEST(TestSetIntersectionAscending); template void TestSetIntersectionEquivalentRanges(const size_t n) { - thrust::host_vector temp = thrusttest::random_integers(n); + thrust::host_vector temp = unittest::random_integers(n); thrust::host_vector h_a = temp; thrust::host_vector h_b = temp; @@ -167,7 +167,7 @@ DECLARE_VARIABLE_UNITTEST(TestSetIntersectionEquivalentRanges); template void TestSetIntersectionMultiset(const size_t n) { - thrust::host_vector temp = thrusttest::random_integers(2 * n); + thrust::host_vector temp = unittest::random_integers(2 * n); // restrict elements to [min,13) for(typename thrust::host_vector::iterator i = temp.begin(); @@ -246,7 +246,7 @@ void TestSetIntersectionNonArithmetic(void) typedef non_arithmetic T; - thrust::host_vector temp = thrusttest::random_integers(2 * n); + thrust::host_vector temp = unittest::random_integers(2 * n); thrust::host_vector h_a(temp.begin(), temp.begin() + n); thrust::host_vector h_b(temp.begin() + n, temp.end()); diff --git a/testing/sort.cu b/testing/sort.cu index 505d7b35b..76db47f94 100644 --- a/testing/sort.cu +++ b/testing/sort.cu @@ -1,4 +1,4 @@ -#include +#include #include #include @@ -189,7 +189,7 @@ DECLARE_VECTOR_UNITTEST(TestStableSortByKeySimple); template void TestSortAscendingKey(const size_t n) { - thrust::host_vector h_data = thrusttest::random_integers(n); + thrust::host_vector h_data = unittest::random_integers(n); thrust::device_vector d_data = h_data; thrust::sort(h_data.begin(), h_data.end(), thrust::less()); @@ -203,7 +203,7 @@ void TestSortDescendingKey(void) { const size_t n = 10027; - thrust::host_vector h_data = thrusttest::random_integers(n); + thrust::host_vector h_data = unittest::random_integers(n); thrust::device_vector d_data = h_data; thrust::sort(h_data.begin(), h_data.end(), thrust::greater()); @@ -217,7 +217,7 @@ DECLARE_UNITTEST(TestSortDescendingKey); template void TestStableSortAscendingKey(const size_t n) { - thrust::host_vector h_data = thrusttest::random_integers(n); + thrust::host_vector h_data = unittest::random_integers(n); thrust::device_vector d_data = h_data; thrust::stable_sort(h_data.begin(), h_data.end(), less_div_10()); @@ -232,7 +232,7 @@ void TestStableSortDescendingKey(void) { const size_t n = 10027; - thrust::host_vector h_data = thrusttest::random_integers(n); + thrust::host_vector h_data = unittest::random_integers(n); thrust::device_vector d_data = h_data; thrust::stable_sort(h_data.begin(), h_data.end(), greater_div_10()); @@ -247,10 +247,10 @@ DECLARE_UNITTEST(TestStableSortDescendingKey); template void TestSortAscendingKeyValue(const size_t n) { - thrust::host_vector h_keys = thrusttest::random_integers(n); + thrust::host_vector h_keys = unittest::random_integers(n); thrust::device_vector d_keys = h_keys; - thrust::host_vector h_values = thrusttest::random_integers(n); + thrust::host_vector h_values = unittest::random_integers(n); thrust::device_vector d_values = h_values; thrust::sort_by_key(h_keys.begin(), h_keys.end(), h_values.begin(), thrust::less()); @@ -266,10 +266,10 @@ void TestSortDescendingKeyValue(void) { const size_t n = 10027; - thrust::host_vector h_keys = thrusttest::random_integers(n); + thrust::host_vector h_keys = unittest::random_integers(n); thrust::device_vector d_keys = h_keys; - thrust::host_vector h_values = thrusttest::random_integers(n); + thrust::host_vector h_values = unittest::random_integers(n); thrust::device_vector d_values = h_values; thrust::sort_by_key(h_keys.begin(), h_keys.end(), h_values.begin(), thrust::greater()); @@ -284,10 +284,10 @@ DECLARE_UNITTEST(TestSortDescendingKeyValue); template void TestStableSortAscendingKeyValue(const size_t n) { - thrust::host_vector h_keys = thrusttest::random_integers(n); + thrust::host_vector h_keys = unittest::random_integers(n); thrust::device_vector d_keys = h_keys; - thrust::host_vector h_values = thrusttest::random_integers(n); + thrust::host_vector h_values = unittest::random_integers(n); thrust::device_vector d_values = h_values; thrust::stable_sort_by_key(h_keys.begin(), h_keys.end(), h_values.begin(), less_div_10()); @@ -303,10 +303,10 @@ void TestStableSortDescendingKeyValue(void) { const size_t n = 10027; - thrust::host_vector h_keys = thrusttest::random_integers(n); + thrust::host_vector h_keys = unittest::random_integers(n); thrust::device_vector d_keys = h_keys; - thrust::host_vector h_values = thrusttest::random_integers(n); + thrust::host_vector h_values = unittest::random_integers(n); thrust::device_vector d_values = h_values; thrust::stable_sort_by_key(h_keys.begin(), h_keys.end(), h_values.begin(), greater_div_10()); diff --git a/testing/swap_ranges.cu b/testing/swap_ranges.cu index 34d79e673..151f0b3be 100644 --- a/testing/swap_ranges.cu +++ b/testing/swap_ranges.cu @@ -1,4 +1,4 @@ -#include +#include #include template @@ -76,8 +76,8 @@ DECLARE_VECTOR_UNITTEST(TestSwapMixedRanges); template void TestSwapRanges(const size_t n) { - thrust::host_vector a1 = thrusttest::random_integers(n); - thrust::host_vector a2 = thrusttest::random_integers(n); + thrust::host_vector a1 = unittest::random_integers(n); + thrust::host_vector a2 = unittest::random_integers(n); thrust::host_vector h1 = a1; thrust::host_vector h2 = a2; diff --git a/testing/testframework.cu b/testing/testframework.cu index d0aa7a5c7..841bf7443 100644 --- a/testing/testframework.cu +++ b/testing/testframework.cu @@ -1,5 +1,5 @@ -#include "thrusttest/testframework.h" -#include "thrusttest/exceptions.h" +#include "unittest/testframework.h" +#include "unittest/exceptions.h" #include #include @@ -103,7 +103,7 @@ struct TestResult : status(status), name(u->name) { } - TestResult(const TestStatus status, const UnitTest * u, const thrusttest::UnitTestException& e) + TestResult(const TestStatus status, const UnitTest * u, const unittest::UnitTestException& e) : status(status), name(u->name), message(e.message) { } @@ -212,15 +212,15 @@ bool UnitTestDriver::run_tests(const std::vector &tests_to_run, cons // test passed record_result(TestResult(Pass, test), test_results); } - catch (thrusttest::UnitTestFailure& f) + catch (unittest::UnitTestFailure& f) { record_result(TestResult(Failure, test, f), test_results); } - catch (thrusttest::UnitTestKnownFailure& f) + catch (unittest::UnitTestKnownFailure& f) { record_result(TestResult(KnownFailure, test, f), test_results); } - catch (thrusttest::UnitTestError& e) + catch (unittest::UnitTestError& e) { record_result(TestResult(Error, test, e), test_results); } diff --git a/testing/thrusttest/unittest.h b/testing/thrusttest/unittest.h deleted file mode 100644 index c4914e1f4..000000000 --- a/testing/thrusttest/unittest.h +++ /dev/null @@ -1,11 +0,0 @@ -#pragma once - -// this is the only header included by unittests -// it pulls in all the others used for unittesting - -#include -#include -#include -#include -#include - diff --git a/testing/transform.cu b/testing/transform.cu index 156666ae0..4540f0495 100644 --- a/testing/transform.cu +++ b/testing/transform.cu @@ -1,4 +1,4 @@ -#include +#include #include #include @@ -112,7 +112,7 @@ DECLARE_VECTOR_UNITTEST(TestTransformIfBinarySimple); template void TestTransformUnary(const size_t n) { - thrust::host_vector h_input = thrusttest::random_integers(n); + thrust::host_vector h_input = unittest::random_integers(n); thrust::device_vector d_input = h_input; thrust::host_vector h_output(n); @@ -140,9 +140,9 @@ struct is_positive template void TestTransformIfUnary(const size_t n) { - thrust::host_vector h_input = thrusttest::random_integers(n); - thrust::host_vector h_stencil = thrusttest::random_integers(n); - thrust::host_vector h_output = thrusttest::random_integers(n); + thrust::host_vector h_input = unittest::random_integers(n); + thrust::host_vector h_stencil = unittest::random_integers(n); + thrust::host_vector h_output = unittest::random_integers(n); thrust::device_vector d_input = h_input; thrust::device_vector d_stencil = h_stencil; @@ -166,8 +166,8 @@ DECLARE_VARIABLE_UNITTEST(TestTransformIfUnary); template void TestTransformBinary(const size_t n) { - thrust::host_vector h_input1 = thrusttest::random_integers(n); - thrust::host_vector h_input2 = thrusttest::random_integers(n); + thrust::host_vector h_input1 = unittest::random_integers(n); + thrust::host_vector h_input2 = unittest::random_integers(n); thrust::device_vector d_input1 = h_input1; thrust::device_vector d_input2 = h_input2; @@ -190,10 +190,10 @@ DECLARE_VARIABLE_UNITTEST(TestTransformBinary); template void TestTransformIfBinary(const size_t n) { - thrust::host_vector h_input1 = thrusttest::random_integers(n); - thrust::host_vector h_input2 = thrusttest::random_integers(n); - thrust::host_vector h_stencil = thrusttest::random_integers(n); - thrust::host_vector h_output = thrusttest::random_integers(n); + thrust::host_vector h_input1 = unittest::random_integers(n); + thrust::host_vector h_input2 = unittest::random_integers(n); + thrust::host_vector h_stencil = unittest::random_integers(n); + thrust::host_vector h_output = unittest::random_integers(n); thrust::device_vector d_input1 = h_input1; thrust::device_vector d_input2 = h_input2; @@ -214,7 +214,7 @@ void TestTransformIfBinary(const size_t n) ASSERT_EQUAL(h_output, d_output); - h_stencil = thrusttest::random_integers(n); + h_stencil = unittest::random_integers(n); d_stencil = h_stencil; thrust::transform_if(h_input1.begin(), h_input1.end(), diff --git a/testing/transform_iterator.cu b/testing/transform_iterator.cu index 37dd6b10c..e28e333e1 100644 --- a/testing/transform_iterator.cu +++ b/testing/transform_iterator.cu @@ -1,4 +1,4 @@ -#include +#include #include #include @@ -68,7 +68,7 @@ struct TestTransformIteratorReduce { void operator()(const size_t n) { - thrust::host_vector h_data = thrusttest::random_samples(n); + thrust::host_vector h_data = unittest::random_samples(n); thrust::device_vector d_data = h_data; // run on host diff --git a/testing/transform_reduce.cu b/testing/transform_reduce.cu index a7cdc90db..728f07295 100644 --- a/testing/transform_reduce.cu +++ b/testing/transform_reduce.cu @@ -1,4 +1,4 @@ -#include +#include #include #include @@ -22,7 +22,7 @@ DECLARE_VECTOR_UNITTEST(TestTransformReduceSimple); template void TestTransformReduce(const size_t n) { - thrust::host_vector h_data = thrusttest::random_integers(n); + thrust::host_vector h_data = unittest::random_integers(n); thrust::device_vector d_data = h_data; T init = 13; @@ -37,7 +37,7 @@ DECLARE_VARIABLE_UNITTEST(TestTransformReduce); template void TestTransformReduceFromConst(const size_t n) { - thrust::host_vector h_data = thrusttest::random_integers(n); + thrust::host_vector h_data = unittest::random_integers(n); thrust::device_vector d_data = h_data; T init = 13; diff --git a/testing/transform_scan.cu b/testing/transform_scan.cu index 3566895a1..9561c7b46 100644 --- a/testing/transform_scan.cu +++ b/testing/transform_scan.cu @@ -1,4 +1,4 @@ -#include +#include #include #include @@ -61,7 +61,7 @@ DECLARE_VECTOR_UNITTEST(TestTransformScanSimple); template void TestTransformScan(const size_t n) { - thrust::host_vector h_input = thrusttest::random_integers(n); + thrust::host_vector h_input = unittest::random_integers(n); for(size_t i = 0; i < n; i++) h_input[i] = (((int) h_input[i]) % 81 - 40) / 4.0; // floats will be XX.0, XX.25, XX.5, or XX.75 thrust::device_vector d_input = h_input; diff --git a/testing/trivial_sequence.cu b/testing/trivial_sequence.cu index b3f9b2282..bf3fba5e1 100644 --- a/testing/trivial_sequence.cu +++ b/testing/trivial_sequence.cu @@ -1,4 +1,4 @@ -#include +#include #include #include diff --git a/testing/tuple.cu b/testing/tuple.cu index 8a9bdc435..0fbb086c6 100644 --- a/testing/tuple.cu +++ b/testing/tuple.cu @@ -1,11 +1,11 @@ -#include +#include #include #include #include #include #include -using namespace thrusttest; +using namespace unittest; using namespace thrust; template @@ -365,8 +365,8 @@ struct TestTupleStableSort { void operator()(const size_t n) { - thrust::host_vector h_keys = thrusttest::random_integers(n); - thrust::host_vector h_values = thrusttest::random_integers(n); + thrust::host_vector h_keys = unittest::random_integers(n); + thrust::host_vector h_values = unittest::random_integers(n); // zip up the data thrust::host_vector< tuple > h_tuples(n); @@ -408,8 +408,8 @@ struct TestTupleReduce { void operator()(const size_t n) { - thrust::host_vector h_t1 = thrusttest::random_integers(n); - thrust::host_vector h_t2 = thrusttest::random_integers(n); + thrust::host_vector h_t1 = unittest::random_integers(n); + thrust::host_vector h_t2 = unittest::random_integers(n); // zip up the data thrust::host_vector< tuple > h_tuples(n); @@ -436,8 +436,8 @@ struct TestTupleScan { void operator()(const size_t n) { - thrust::host_vector h_t1 = thrusttest::random_integers(n); - thrust::host_vector h_t2 = thrusttest::random_integers(n); + thrust::host_vector h_t1 = unittest::random_integers(n); + thrust::host_vector h_t2 = unittest::random_integers(n); // zip up the data thrust::host_vector< tuple > h_tuples(n); @@ -467,8 +467,8 @@ struct TestTupleTransform { void operator()(const size_t n) { - thrust::host_vector h_t1 = thrusttest::random_integers(n); - thrust::host_vector h_t2 = thrusttest::random_integers(n); + thrust::host_vector h_t1 = unittest::random_integers(n); + thrust::host_vector h_t2 = unittest::random_integers(n); // zip up the data thrust::host_vector< tuple > h_tuples(n); diff --git a/testing/type_traits.cu b/testing/type_traits.cu index 963b531b7..823eb0142 100644 --- a/testing/type_traits.cu +++ b/testing/type_traits.cu @@ -1,4 +1,4 @@ -#include +#include #include #include diff --git a/testing/uninitialized_copy.cu b/testing/uninitialized_copy.cu index bc6f585c3..dfc9826c6 100644 --- a/testing/uninitialized_copy.cu +++ b/testing/uninitialized_copy.cu @@ -1,4 +1,4 @@ -#include +#include #include #include @@ -51,6 +51,6 @@ struct TestUninitializedCopySimpleNonPOD KNOWN_FAILURE } }; -VectorUnitTest, Wrap >, thrust::device_vector, thrust::device_malloc_allocator> gTestUninitializedCopyNonPODSimpleDeviceInstance; -VectorUnitTest, Wrap >, thrust::host_vector, std::allocator> gTestUninitializedCopyNonPODSimpleHostInstance; +VectorUnitTest, Wrap >, thrust::device_vector, thrust::device_malloc_allocator> gTestUninitializedCopyNonPODSimpleDeviceInstance; +VectorUnitTest, Wrap >, thrust::host_vector, std::allocator> gTestUninitializedCopyNonPODSimpleHostInstance; diff --git a/testing/uninitialized_fill.cu b/testing/uninitialized_fill.cu index 0ee2c0e27..676c13fed 100644 --- a/testing/uninitialized_fill.cu +++ b/testing/uninitialized_fill.cu @@ -1,4 +1,4 @@ -#include +#include #include #include @@ -91,29 +91,29 @@ struct TestUninitializedFillNonPOD // XXX nvcc 3.0b can generate this code correctly, // but leave this as a known fail for now KNOWN_FAILURE - typedef CopyConstructTest T; - thrust::device_ptr v = thrust::device_malloc(5); + //typedef CopyConstructTest T; + //thrust::device_ptr v = thrust::device_malloc(5); - T exemplar; - ASSERT_EQUAL(false, exemplar.copy_constructed_on_device); - ASSERT_EQUAL(false, exemplar.copy_constructed_on_host); + //T exemplar; + //ASSERT_EQUAL(false, exemplar.copy_constructed_on_device); + //ASSERT_EQUAL(false, exemplar.copy_constructed_on_host); - T host_copy_of_exemplar(exemplar); - ASSERT_EQUAL(false, exemplar.copy_constructed_on_device); - ASSERT_EQUAL(true, exemplar.copy_constructed_on_host); + //T host_copy_of_exemplar(exemplar); + //ASSERT_EQUAL(false, exemplar.copy_constructed_on_device); + //ASSERT_EQUAL(true, exemplar.copy_constructed_on_host); - // copy construct v from the exemplar - thrust::uninitialized_fill(v, v + 1, exemplar); + //// copy construct v from the exemplar + //thrust::uninitialized_fill(v, v + 1, exemplar); - T x; - ASSERT_EQUAL(false, x.copy_constructed_on_device); - ASSERT_EQUAL(false, x.copy_constructed_on_host); + //T x; + //ASSERT_EQUAL(false, x.copy_constructed_on_device); + //ASSERT_EQUAL(false, x.copy_constructed_on_host); - x = v[0]; - ASSERT_EQUAL(true, x.copy_constructed_on_device); - ASSERT_EQUAL(false, x.copy_constructed_on_host); + //x = v[0]; + //ASSERT_EQUAL(true, x.copy_constructed_on_device); + //ASSERT_EQUAL(false, x.copy_constructed_on_host); - thrust::device_free(v); + //thrust::device_free(v); } }; DECLARE_UNITTEST(TestUninitializedFillNonPOD); diff --git a/testing/unique.cu b/testing/unique.cu index ba161dad4..889aaf3a2 100644 --- a/testing/unique.cu +++ b/testing/unique.cu @@ -1,4 +1,4 @@ -#include +#include #include #include @@ -54,7 +54,7 @@ struct TestUnique { void operator()(const size_t n) { - thrust::host_vector h_data = thrusttest::random_integers(n); + thrust::host_vector h_data = unittest::random_integers(n); thrust::device_vector d_data = h_data; typename thrust::host_vector::iterator h_new_last; @@ -121,7 +121,7 @@ struct TestUniqueCopy { void operator()(const size_t n) { - thrust::host_vector h_data = thrusttest::random_integers(n); + thrust::host_vector h_data = unittest::random_integers(n); thrust::device_vector d_data = h_data; thrust::host_vector h_output(n); @@ -279,8 +279,8 @@ struct TestUniqueByKey { typedef unsigned int V; // ValueType - thrust::host_vector h_keys = thrusttest::random_integers(n); - thrust::host_vector h_vals = thrusttest::random_integers(n); + thrust::host_vector h_keys = unittest::random_integers(n); + thrust::host_vector h_vals = unittest::random_integers(n); thrust::device_vector d_keys = h_keys; thrust::device_vector d_vals = h_vals; @@ -319,8 +319,8 @@ struct TestUniqueCopyByKey { typedef unsigned int V; // ValueType - thrust::host_vector h_keys = thrusttest::random_integers(n); - thrust::host_vector h_vals = thrusttest::random_integers(n); + thrust::host_vector h_keys = unittest::random_integers(n); + thrust::host_vector h_vals = unittest::random_integers(n); thrust::device_vector d_keys = h_keys; thrust::device_vector d_vals = h_vals; diff --git a/testing/thrusttest/assertions.h b/testing/unittest/assertions.h similarity index 89% rename from testing/thrusttest/assertions.h rename to testing/unittest/assertions.h index c7304d7f3..6ddf70ece 100644 --- a/testing/thrusttest/assertions.h +++ b/testing/unittest/assertions.h @@ -5,15 +5,15 @@ #include #include -#include -#include - -#define ASSERT_EQUAL_QUIET(X,Y) thrusttest::assert_equal_quiet((X),(Y), __FILE__, __LINE__) -#define ASSERT_EQUAL(X,Y) thrusttest::assert_equal((X),(Y), __FILE__, __LINE__) -#define ASSERT_LEQUAL(X,Y) thrusttest::assert_lequal((X),(Y), __FILE__, __LINE__) -#define ASSERT_GEQUAL(X,Y) thrusttest::assert_gequal((X),(Y), __FILE__, __LINE__) -#define ASSERT_ALMOST_EQUAL(X,Y) thrusttest::assert_almost_equal((X),(Y), __FILE__, __LINE__) -#define KNOWN_FAILURE { thrusttest::UnitTestKnownFailure f; f << "[" << __FILE__ ":" << __LINE__ << "]"; throw f;} +#include +#include + +#define ASSERT_EQUAL_QUIET(X,Y) unittest::assert_equal_quiet((X),(Y), __FILE__, __LINE__) +#define ASSERT_EQUAL(X,Y) unittest::assert_equal((X),(Y), __FILE__, __LINE__) +#define ASSERT_LEQUAL(X,Y) unittest::assert_lequal((X),(Y), __FILE__, __LINE__) +#define ASSERT_GEQUAL(X,Y) unittest::assert_gequal((X),(Y), __FILE__, __LINE__) +#define ASSERT_ALMOST_EQUAL(X,Y) unittest::assert_almost_equal((X),(Y), __FILE__, __LINE__) +#define KNOWN_FAILURE { unittest::UnitTestKnownFailure f; f << "[" << __FILE__ ":" << __LINE__ << "]"; throw f;} #define ASSERT_EQUAL_RANGES(X,Y,Z) unittest::assert_equal((X),(Y),(Z), __FILE__, __LINE__) @@ -23,7 +23,7 @@ } -namespace thrusttest +namespace unittest { static size_t MAX_OUTPUT_LINES = 10; @@ -57,7 +57,7 @@ void assert_equal(const T1& a, const T2& b, typedef typename value_type::type T; if(!(T(a) == T(b))){ - thrusttest::UnitTestFailure f; + unittest::UnitTestFailure f; f << "[" << filename << ":" << lineno << "] "; f << "values are not equal: " << a << " " << b; f << " [type='" << type_name() << "']"; @@ -71,7 +71,7 @@ void assert_equal_quiet(const T1& a, const T2& b, const std::string& filename = "unknown", int lineno = -1) { if(!(a == b)){ - thrusttest::UnitTestFailure f; + unittest::UnitTestFailure f; f << "[" << filename << ":" << lineno << "] "; f << "values are not equal."; f << " [type='" << type_name() << "']"; @@ -84,7 +84,7 @@ void assert_lequal(const T1& a, const T2& b, const std::string& filename = "unknown", int lineno = -1) { if(!(a <= b)){ - thrusttest::UnitTestFailure f; + unittest::UnitTestFailure f; f << "[" << filename << ":" << lineno << "] "; f << a << " is greater than " << b; f << " [type='" << type_name() << "']"; @@ -97,7 +97,7 @@ void assert_gequal(const T1& a, const T2& b, const std::string& filename = "unknown", int lineno = -1) { if(!(a >= b)){ - thrusttest::UnitTestFailure f; + unittest::UnitTestFailure f; f << "[" << filename << ":" << lineno << "] "; f << a << " is less than " << b; f << " [type='" << type_name() << "']"; @@ -129,7 +129,7 @@ void assert_almost_equal(const T1& a, const T2& b, { if(!almost_equal(a, b, a_tol, r_tol)){ - thrusttest::UnitTestFailure f; + unittest::UnitTestFailure f; f << "[" << filename << ":" << lineno << "] "; f << "values are not approximately equal: " << (double) a << " " << (double) b; f << " [type='" << type_name() << "']"; @@ -160,7 +160,7 @@ void assert_equal(ForwardIterator first1, ForwardIterator last1, ForwardIterator typedef typename thrust::iterator_traits::value_type InputType; - thrusttest::UnitTestFailure f; + unittest::UnitTestFailure f; f << "[" << filename << ":" << lineno << "] "; f << "Sequences are not equal [type='" << type_name() << "']\n"; f << "--------------------------------\n"; @@ -212,7 +212,7 @@ void assert_equal(const thrust::host_vector& A, const thrust::host_vect const std::string& filename = "unknown", int lineno = -1) { if(A.size() != B.size()) - throw thrusttest::UnitTestError("Sequences have different sizes"); + throw unittest::UnitTestError("Sequences have different sizes"); assert_equal(A.begin(), A.end(), B.begin(), filename, lineno); } @@ -222,7 +222,7 @@ void assert_almost_equal(const thrust::host_vector& A, const thrust::ho const double a_tol = DEFAULT_ABSOLUTE_TOL, const double r_tol = DEFAULT_RELATIVE_TOL) { if(A.size() != B.size()) - throw thrusttest::UnitTestError("Sequences have different sizes"); + throw unittest::UnitTestError("Sequences have different sizes"); assert_almost_equal(A.begin(), A.end(), B.begin(), filename, lineno, a_tol, r_tol); } @@ -279,4 +279,4 @@ void assert_almost_equal(const thrust::device_vector& A, const thrust:: assert_almost_equal(A_host, B_host, filename, lineno, a_tol, r_tol); } -}; //end namespace thrusttest +}; //end namespace unittest diff --git a/testing/thrusttest/exceptions.h b/testing/unittest/exceptions.h similarity index 95% rename from testing/thrusttest/exceptions.h rename to testing/unittest/exceptions.h index c29f8d1be..3f3633fd6 100644 --- a/testing/thrusttest/exceptions.h +++ b/testing/unittest/exceptions.h @@ -4,7 +4,7 @@ #include #include -namespace thrusttest +namespace unittest { class UnitTestException @@ -53,4 +53,4 @@ class UnitTestKnownFailure : public UnitTestException }; -}; //end namespace thrusttest +}; //end namespace unittest diff --git a/testing/thrusttest/meta.h b/testing/unittest/meta.h similarity index 99% rename from testing/thrusttest/meta.h rename to testing/unittest/meta.h index b6bbd00ce..9a2b6d8a8 100644 --- a/testing/thrusttest/meta.h +++ b/testing/unittest/meta.h @@ -6,7 +6,7 @@ #pragma once -namespace thrusttest +namespace unittest { // mark the absence of a type @@ -256,5 +256,5 @@ template type; }; -} // end thrusttest +} // end unittest diff --git a/testing/thrusttest/random.h b/testing/unittest/random.h similarity index 96% rename from testing/thrusttest/random.h rename to testing/unittest/random.h index 908656099..8e8c80c6d 100644 --- a/testing/thrusttest/random.h +++ b/testing/unittest/random.h @@ -7,7 +7,7 @@ const unsigned int DEFAULT_SEED = 13; -namespace thrusttest +namespace unittest { template @@ -110,5 +110,5 @@ thrust::host_vector random_samples(const size_t N) return vec; } -}; //end namespace thrusttest +}; //end namespace unittest diff --git a/testing/thrusttest/special_types.h b/testing/unittest/special_types.h similarity index 100% rename from testing/thrusttest/special_types.h rename to testing/unittest/special_types.h diff --git a/testing/thrusttest/system.h b/testing/unittest/system.h similarity index 92% rename from testing/thrusttest/system.h rename to testing/unittest/system.h index 59c30811b..87a1746ae 100644 --- a/testing/thrusttest/system.h +++ b/testing/unittest/system.h @@ -6,7 +6,7 @@ #include #endif // __GNUC__ -namespace thrusttest +namespace unittest { #ifdef _CXXABI_H @@ -28,5 +28,5 @@ inline const char* demangle(const char* name) } #endif -} // end thrusttest +} // end unittest diff --git a/testing/thrusttest/testframework.h b/testing/unittest/testframework.h similarity index 85% rename from testing/thrusttest/testframework.h rename to testing/unittest/testframework.h index ef5c5105b..c6bc54a34 100644 --- a/testing/thrusttest/testframework.h +++ b/testing/unittest/testframework.h @@ -12,15 +12,15 @@ #include "util.h" // define some common lists of types -typedef thrusttest::type_list ThirtyTwoBitTypes; -typedef thrusttest::type_list SixtyFourBitTypes; -typedef thrusttest::type_list IntegralTypes; -typedef thrusttest::type_list SignedIntegralTypes; -typedef thrusttest::type_list UnsignedIntegralTypes; -typedef thrusttest::type_list ByteTypes; -typedef thrusttest::type_list SmallIntegralTypes; -typedef thrusttest::type_list LargeIntegralTypes; -typedef thrusttest::type_list= 130 , double #endif // __CUDA_ARCH__ > FloatTypes; -typedef thrusttest::type_list class TestName, typename TypeList> { public: SimpleUnitTest() - : UnitTest(base_class_name(thrusttest::type_name >()).c_str()) {} + : UnitTest(base_class_name(unittest::type_name >()).c_str()) {} void run() { // get the first type in the list - typedef typename thrusttest::get_type::type first_type; + typedef typename unittest::get_type::type first_type; - thrusttest::for_each_type for_each; + unittest::for_each_type for_each; // loop over the types for_each(); @@ -193,7 +193,7 @@ template