From cab9eff439446e01891e6830a6b6b49a0615adc7 Mon Sep 17 00:00:00 2001 From: Jared Hoberock Date: Sun, 24 May 2009 11:34:22 +0000 Subject: [PATCH] Replace "komrade" with "thrust" in performance/ --HG-- extra : convert_revision : svn%3A83215879-3e5a-4751-8c9d-778f44bb06a5/trunk%4091 --- performance/build/test_function_template.cxx | 2 +- performance/build/test_program_template.cxx | 2 +- performance/fill.test | 12 ++++----- performance/inclusive_scan.test | 16 ++++++------ performance/inner_product.test | 16 ++++++------ performance/merge_sort.test | 16 ++++++------ performance/merge_sort_by_key.test | 26 ++++++++++---------- performance/radix_sort.test | 16 ++++++------ performance/radix_sort_by_key.test | 26 ++++++++++---------- performance/reduce.test | 12 ++++----- performance/reduce_float.test | 8 +++--- performance/report.py | 4 +-- performance/sort.test | 16 ++++++------ performance/sort_by_key.test | 26 ++++++++++---------- performance/sort_large.test | 16 ++++++------ performance/unique.test | 20 +++++++-------- 16 files changed, 117 insertions(+), 117 deletions(-) diff --git a/performance/build/test_function_template.cxx b/performance/build/test_function_template.cxx index 6b2b4ce55..7f035900b 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 (komradetest::UnitTestException e) { + catch (thrusttest::UnitTestException e) { RECORD_TEST_FAILURE(e); } diff --git a/performance/build/test_program_template.cxx b/performance/build/test_program_template.cxx index abf945e99..317bb4aad 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/fill.test b/performance/fill.test index 6a881cc11..bfac6dc5c 100644 --- a/performance/fill.test +++ b/performance/fill.test @@ -1,22 +1,22 @@ PREAMBLE = \ """ - #include + #include """ INITIALIZE = \ """ - komrade::host_vector<$InputType> h_input($InputSize); - komrade::device_vector<$InputType> d_input($InputSize); + thrust::host_vector<$InputType> h_input($InputSize); + thrust::device_vector<$InputType> d_input($InputSize); - komrade::fill(h_input.begin(), h_input.end(), $InputType(13)); - komrade::fill(d_input.begin(), d_input.end(), $InputType(13)); + thrust::fill(h_input.begin(), h_input.end(), $InputType(13)); + thrust::fill(d_input.begin(), d_input.end(), $InputType(13)); ASSERT_EQUAL(h_input, d_input); """ TIME = \ """ - komrade::fill(d_input.begin(), d_input.end(), $InputType(13)); + thrust::fill(d_input.begin(), d_input.end(), $InputType(13)); """ FINALIZE = \ diff --git a/performance/inclusive_scan.test b/performance/inclusive_scan.test index 7b1020c84..ee7b0502c 100644 --- a/performance/inclusive_scan.test +++ b/performance/inclusive_scan.test @@ -1,25 +1,25 @@ PREAMBLE = \ """ - #include + #include """ INITIALIZE = \ """ - komrade::host_vector<$InputType> h_input = komradetest::random_integers<$InputType>($InputSize); - komrade::device_vector<$InputType> d_input = h_input; + thrust::host_vector<$InputType> h_input = thrusttest::random_integers<$InputType>($InputSize); + thrust::device_vector<$InputType> d_input = h_input; - komrade::host_vector<$InputType> h_output($InputSize); - komrade::device_vector<$InputType> d_output($InputSize); + thrust::host_vector<$InputType> h_output($InputSize); + thrust::device_vector<$InputType> d_output($InputSize); - komrade::inclusive_scan(h_input.begin(), h_input.end(), h_output.begin()); - komrade::inclusive_scan(d_input.begin(), d_input.end(), d_output.begin()); + thrust::inclusive_scan(h_input.begin(), h_input.end(), h_output.begin()); + thrust::inclusive_scan(d_input.begin(), d_input.end(), d_output.begin()); ASSERT_EQUAL(h_output, d_output); """ TIME = \ """ - komrade::inclusive_scan(d_input.begin(), d_input.end(), d_output.begin()); + thrust::inclusive_scan(d_input.begin(), d_input.end(), d_output.begin()); """ FINALIZE = \ diff --git a/performance/inner_product.test b/performance/inner_product.test index 056d31f3e..d55ceb490 100644 --- a/performance/inner_product.test +++ b/performance/inner_product.test @@ -1,25 +1,25 @@ PREAMBLE = \ """ - #include + #include """ INITIALIZE = \ """ - komrade::host_vector<$InputType> h_input1 = komradetest::random_integers<$InputType>($InputSize); - komrade::host_vector<$InputType> h_input2 = komradetest::random_integers<$InputType>($InputSize); - komrade::device_vector<$InputType> d_input1 = h_input1; - komrade::device_vector<$InputType> d_input2 = h_input2; + thrust::host_vector<$InputType> h_input1 = thrusttest::random_integers<$InputType>($InputSize); + thrust::host_vector<$InputType> h_input2 = thrusttest::random_integers<$InputType>($InputSize); + thrust::device_vector<$InputType> d_input1 = h_input1; + thrust::device_vector<$InputType> d_input2 = h_input2; $InputType init = 13; - $InputType h_result = komrade::inner_product(h_input1.begin(), h_input1.end(), h_input2.begin(), init); - $InputType d_result = komrade::inner_product(d_input1.begin(), d_input1.end(), d_input2.begin(), init); + $InputType h_result = thrust::inner_product(h_input1.begin(), h_input1.end(), h_input2.begin(), init); + $InputType d_result = thrust::inner_product(d_input1.begin(), d_input1.end(), d_input2.begin(), init); ASSERT_EQUAL(h_result, d_result); """ TIME = \ """ - komrade::inner_product(d_input1.begin(), d_input1.end(), d_input2.begin(), init); + thrust::inner_product(d_input1.begin(), d_input1.end(), d_input2.begin(), init); """ FINALIZE = \ diff --git a/performance/merge_sort.test b/performance/merge_sort.test index b7caab941..e2c59052c 100644 --- a/performance/merge_sort.test +++ b/performance/merge_sort.test @@ -1,25 +1,25 @@ PREAMBLE = \ """ - #include + #include """ INITIALIZE = \ """ - komrade::host_vector<$KeyType> h_keys = komradetest::random_integers<$KeyType>($InputSize); - komrade::device_vector<$KeyType> d_keys = h_keys; - komrade::device_vector<$KeyType> d_keys_copy = d_keys; + thrust::host_vector<$KeyType> h_keys = thrusttest::random_integers<$KeyType>($InputSize); + thrust::device_vector<$KeyType> d_keys = h_keys; + thrust::device_vector<$KeyType> d_keys_copy = d_keys; // test sort - komrade::sorting::merge_sort(h_keys.begin(), h_keys.end()); - komrade::sorting::merge_sort(d_keys.begin(), d_keys.end()); + thrust::sorting::merge_sort(h_keys.begin(), h_keys.end()); + thrust::sorting::merge_sort(d_keys.begin(), d_keys.end()); ASSERT_EQUAL(d_keys, h_keys); """ TIME = \ """ - komrade::copy(d_keys_copy.begin(), d_keys_copy.end(), d_keys.begin()); - komrade::sorting::merge_sort(d_keys.begin(), d_keys.end()); + thrust::copy(d_keys_copy.begin(), d_keys_copy.end(), d_keys.begin()); + thrust::sorting::merge_sort(d_keys.begin(), d_keys.end()); """ FINALIZE = \ diff --git a/performance/merge_sort_by_key.test b/performance/merge_sort_by_key.test index e964c6817..3d73274eb 100644 --- a/performance/merge_sort_by_key.test +++ b/performance/merge_sort_by_key.test @@ -1,24 +1,24 @@ PREAMBLE = \ """ - #include - #include + #include + #include """ INITIALIZE = \ """ - komrade::host_vector<$KeyType> h_keys = komradetest::random_integers<$KeyType>($InputSize); - komrade::device_vector<$KeyType> d_keys = h_keys; + thrust::host_vector<$KeyType> h_keys = thrusttest::random_integers<$KeyType>($InputSize); + thrust::device_vector<$KeyType> d_keys = h_keys; - komrade::host_vector<$ValueType> h_values($InputSize); - komrade::device_vector<$ValueType> d_values($InputSize); - komrade::range(h_values.begin(), h_values.end()); - komrade::range(d_values.begin(), d_values.end()); + thrust::host_vector<$ValueType> h_values($InputSize); + thrust::device_vector<$ValueType> d_values($InputSize); + thrust::range(h_values.begin(), h_values.end()); + thrust::range(d_values.begin(), d_values.end()); - komrade::device_vector<$KeyType> d_keys_copy = d_keys; + thrust::device_vector<$KeyType> d_keys_copy = d_keys; // test sort - komrade::sorting::merge_sort_by_key(h_keys.begin(), h_keys.end(), h_values.begin()); - komrade::sorting::merge_sort_by_key(d_keys.begin(), d_keys.end(), d_values.begin()); + thrust::sorting::merge_sort_by_key(h_keys.begin(), h_keys.end(), h_values.begin()); + thrust::sorting::merge_sort_by_key(d_keys.begin(), d_keys.end(), d_values.begin()); ASSERT_EQUAL(d_keys, h_keys); ASSERT_EQUAL(d_values, h_values); @@ -26,8 +26,8 @@ INITIALIZE = \ TIME = \ """ - komrade::copy(d_keys_copy.begin(), d_keys_copy.end(), d_keys.begin()); - komrade::sorting::merge_sort_by_key(d_keys.begin(), d_keys.end(), d_values.begin()); + thrust::copy(d_keys_copy.begin(), d_keys_copy.end(), d_keys.begin()); + thrust::sorting::merge_sort_by_key(d_keys.begin(), d_keys.end(), d_values.begin()); """ FINALIZE = \ diff --git a/performance/radix_sort.test b/performance/radix_sort.test index 945514315..8ae306179 100644 --- a/performance/radix_sort.test +++ b/performance/radix_sort.test @@ -1,25 +1,25 @@ PREAMBLE = \ """ - #include + #include """ INITIALIZE = \ """ - komrade::host_vector<$KeyType> h_keys = komradetest::random_integers<$KeyType>($InputSize); - komrade::device_vector<$KeyType> d_keys = h_keys; - komrade::device_vector<$KeyType> d_keys_copy = d_keys; + thrust::host_vector<$KeyType> h_keys = thrusttest::random_integers<$KeyType>($InputSize); + thrust::device_vector<$KeyType> d_keys = h_keys; + thrust::device_vector<$KeyType> d_keys_copy = d_keys; // test sort - komrade::sorting::radix_sort(h_keys.begin(), h_keys.end()); - komrade::sorting::radix_sort(d_keys.begin(), d_keys.end()); + thrust::sorting::radix_sort(h_keys.begin(), h_keys.end()); + thrust::sorting::radix_sort(d_keys.begin(), d_keys.end()); ASSERT_EQUAL(d_keys, h_keys); """ TIME = \ """ - komrade::copy(d_keys_copy.begin(), d_keys_copy.end(), d_keys.begin()); - komrade::sorting::radix_sort(d_keys.begin(), d_keys.end()); + thrust::copy(d_keys_copy.begin(), d_keys_copy.end(), d_keys.begin()); + thrust::sorting::radix_sort(d_keys.begin(), d_keys.end()); """ FINALIZE = \ diff --git a/performance/radix_sort_by_key.test b/performance/radix_sort_by_key.test index 83219508d..b7b3e0b72 100644 --- a/performance/radix_sort_by_key.test +++ b/performance/radix_sort_by_key.test @@ -1,24 +1,24 @@ PREAMBLE = \ """ - #include - #include + #include + #include """ INITIALIZE = \ """ - komrade::host_vector<$KeyType> h_keys = komradetest::random_integers<$KeyType>($InputSize); - komrade::device_vector<$KeyType> d_keys = h_keys; + thrust::host_vector<$KeyType> h_keys = thrusttest::random_integers<$KeyType>($InputSize); + thrust::device_vector<$KeyType> d_keys = h_keys; - komrade::host_vector<$ValueType> h_values($InputSize); - komrade::device_vector<$ValueType> d_values($InputSize); - komrade::range(h_values.begin(), h_values.end()); - komrade::range(d_values.begin(), d_values.end()); + thrust::host_vector<$ValueType> h_values($InputSize); + thrust::device_vector<$ValueType> d_values($InputSize); + thrust::range(h_values.begin(), h_values.end()); + thrust::range(d_values.begin(), d_values.end()); - komrade::device_vector<$KeyType> d_keys_copy = d_keys; + thrust::device_vector<$KeyType> d_keys_copy = d_keys; // test sort - komrade::sorting::radix_sort_by_key(h_keys.begin(), h_keys.end(), h_values.begin()); - komrade::sorting::radix_sort_by_key(d_keys.begin(), d_keys.end(), d_values.begin()); + thrust::sorting::radix_sort_by_key(h_keys.begin(), h_keys.end(), h_values.begin()); + thrust::sorting::radix_sort_by_key(d_keys.begin(), d_keys.end(), d_values.begin()); ASSERT_EQUAL(d_keys, h_keys); ASSERT_EQUAL(d_values, h_values); @@ -26,8 +26,8 @@ INITIALIZE = \ TIME = \ """ - komrade::copy(d_keys_copy.begin(), d_keys_copy.end(), d_keys.begin()); - komrade::sorting::radix_sort_by_key(d_keys.begin(), d_keys.end(), d_values.begin()); + thrust::copy(d_keys_copy.begin(), d_keys_copy.end(), d_keys.begin()); + thrust::sorting::radix_sort_by_key(d_keys.begin(), d_keys.end(), d_values.begin()); """ FINALIZE = \ diff --git a/performance/reduce.test b/performance/reduce.test index e39b909bf..3c4fecc1f 100644 --- a/performance/reduce.test +++ b/performance/reduce.test @@ -1,23 +1,23 @@ PREAMBLE = \ """ - #include + #include """ INITIALIZE = \ """ - komrade::host_vector<$InputType> h_input = komradetest::random_integers<$InputType>($InputSize); - komrade::device_vector<$InputType> d_input = h_input; + thrust::host_vector<$InputType> h_input = thrusttest::random_integers<$InputType>($InputSize); + thrust::device_vector<$InputType> d_input = h_input; $InputType init = 13; - $InputType h_result = komrade::reduce(h_input.begin(), h_input.end(), init); - $InputType d_result = komrade::reduce(d_input.begin(), d_input.end(), init); + $InputType h_result = thrust::reduce(h_input.begin(), h_input.end(), init); + $InputType d_result = thrust::reduce(d_input.begin(), d_input.end(), init); ASSERT_EQUAL(h_result, d_result); """ TIME = \ """ - komrade::reduce(d_input.begin(), d_input.end(), init); + thrust::reduce(d_input.begin(), d_input.end(), init); """ FINALIZE = \ diff --git a/performance/reduce_float.test b/performance/reduce_float.test index d19f71d50..e513a99af 100644 --- a/performance/reduce_float.test +++ b/performance/reduce_float.test @@ -1,12 +1,12 @@ PREAMBLE = \ """ - #include + #include """ INITIALIZE = \ """ - komrade::host_vector<$InputType> h_input = komradetest::random_samples<$InputType>($InputSize); - komrade::device_vector<$InputType> d_input = h_input; + thrust::host_vector<$InputType> h_input = thrusttest::random_samples<$InputType>($InputSize); + thrust::device_vector<$InputType> d_input = h_input; $InputType init = 13; @@ -14,7 +14,7 @@ INITIALIZE = \ TIME = \ """ - komrade::reduce(d_input.begin(), d_input.end(), init); + thrust::reduce(d_input.begin(), d_input.end(), init); """ FINALIZE = \ diff --git a/performance/report.py b/performance/report.py index 5ccb01b83..33c552cb6 100644 --- a/performance/report.py +++ b/performance/report.py @@ -15,6 +15,6 @@ plot_results(method + '_by_key.xml', 'KeyType', 'InputSize', 'Sorting', format=format) for format in ['png', 'pdf']: - plot_results('reduce_float.xml', 'InputType', 'InputSize', 'Bandwidth', dpi=120, plot='semilogx', title='komrade::reduce()', format=format) - plot_results('sort_large.xml', 'KeyType', 'InputSize', 'Sorting', dpi=120, plot='semilogx', title='komrade::sort()', format=format) + plot_results('reduce_float.xml', 'InputType', 'InputSize', 'Bandwidth', dpi=120, plot='semilogx', title='thrust::reduce()', format=format) + plot_results('sort_large.xml', 'KeyType', 'InputSize', 'Sorting', dpi=120, plot='semilogx', title='thrust::sort()', format=format) diff --git a/performance/sort.test b/performance/sort.test index bf73775e1..9b8bc8669 100644 --- a/performance/sort.test +++ b/performance/sort.test @@ -1,25 +1,25 @@ PREAMBLE = \ """ - #include + #include """ INITIALIZE = \ """ - komrade::host_vector<$KeyType> h_keys = komradetest::random_integers<$KeyType>($InputSize); - komrade::device_vector<$KeyType> d_keys = h_keys; - komrade::device_vector<$KeyType> d_keys_copy = d_keys; + thrust::host_vector<$KeyType> h_keys = thrusttest::random_integers<$KeyType>($InputSize); + thrust::device_vector<$KeyType> d_keys = h_keys; + thrust::device_vector<$KeyType> d_keys_copy = d_keys; // test sort - komrade::sort(h_keys.begin(), h_keys.end()); - komrade::sort(d_keys.begin(), d_keys.end()); + thrust::sort(h_keys.begin(), h_keys.end()); + thrust::sort(d_keys.begin(), d_keys.end()); ASSERT_EQUAL(d_keys, h_keys); """ TIME = \ """ - komrade::copy(d_keys_copy.begin(), d_keys_copy.end(), d_keys.begin()); - komrade::sort(d_keys.begin(), d_keys.end()); + thrust::copy(d_keys_copy.begin(), d_keys_copy.end(), d_keys.begin()); + thrust::sort(d_keys.begin(), d_keys.end()); """ FINALIZE = \ diff --git a/performance/sort_by_key.test b/performance/sort_by_key.test index 3b7e4d724..037289f54 100644 --- a/performance/sort_by_key.test +++ b/performance/sort_by_key.test @@ -1,24 +1,24 @@ PREAMBLE = \ """ - #include - #include + #include + #include """ INITIALIZE = \ """ - komrade::host_vector<$KeyType> h_keys = komradetest::random_integers<$KeyType>($InputSize); - komrade::device_vector<$KeyType> d_keys = h_keys; + thrust::host_vector<$KeyType> h_keys = thrusttest::random_integers<$KeyType>($InputSize); + thrust::device_vector<$KeyType> d_keys = h_keys; - komrade::host_vector<$ValueType> h_values($InputSize); - komrade::device_vector<$ValueType> d_values($InputSize); - komrade::range(h_values.begin(), h_values.end()); - komrade::range(d_values.begin(), d_values.end()); + thrust::host_vector<$ValueType> h_values($InputSize); + thrust::device_vector<$ValueType> d_values($InputSize); + thrust::range(h_values.begin(), h_values.end()); + thrust::range(d_values.begin(), d_values.end()); - komrade::device_vector<$KeyType> d_keys_copy = d_keys; + thrust::device_vector<$KeyType> d_keys_copy = d_keys; // test sort - komrade::sort_by_key(h_keys.begin(), h_keys.end(), h_values.begin()); - komrade::sort_by_key(d_keys.begin(), d_keys.end(), d_values.begin()); + thrust::sort_by_key(h_keys.begin(), h_keys.end(), h_values.begin()); + thrust::sort_by_key(d_keys.begin(), d_keys.end(), d_values.begin()); ASSERT_EQUAL(d_keys, h_keys); ASSERT_EQUAL(d_values, h_values); @@ -26,8 +26,8 @@ INITIALIZE = \ TIME = \ """ - komrade::copy(d_keys_copy.begin(), d_keys_copy.end(), d_keys.begin()); - komrade::sort_by_key(d_keys.begin(), d_keys.end(), d_values.begin()); + thrust::copy(d_keys_copy.begin(), d_keys_copy.end(), d_keys.begin()); + thrust::sort_by_key(d_keys.begin(), d_keys.end(), d_values.begin()); """ FINALIZE = \ diff --git a/performance/sort_large.test b/performance/sort_large.test index d52906bf4..ca83f39d1 100644 --- a/performance/sort_large.test +++ b/performance/sort_large.test @@ -1,25 +1,25 @@ PREAMBLE = \ """ - #include + #include """ INITIALIZE = \ """ - komrade::host_vector<$KeyType> h_keys = komradetest::random_integers<$KeyType>($InputSize); - komrade::device_vector<$KeyType> d_keys = h_keys; - komrade::device_vector<$KeyType> d_keys_copy = d_keys; + thrust::host_vector<$KeyType> h_keys = thrusttest::random_integers<$KeyType>($InputSize); + thrust::device_vector<$KeyType> d_keys = h_keys; + thrust::device_vector<$KeyType> d_keys_copy = d_keys; // test sort - komrade::sort(h_keys.begin(), h_keys.end()); - komrade::sort(d_keys.begin(), d_keys.end()); + thrust::sort(h_keys.begin(), h_keys.end()); + thrust::sort(d_keys.begin(), d_keys.end()); ASSERT_EQUAL(d_keys, h_keys); """ TIME = \ """ - komrade::copy(d_keys_copy.begin(), d_keys_copy.end(), d_keys.begin()); - komrade::sort(d_keys.begin(), d_keys.end()); + thrust::copy(d_keys_copy.begin(), d_keys_copy.end(), d_keys.begin()); + thrust::sort(d_keys.begin(), d_keys.end()); """ FINALIZE = \ diff --git a/performance/unique.test b/performance/unique.test index 42873984f..9d43770e3 100644 --- a/performance/unique.test +++ b/performance/unique.test @@ -1,32 +1,32 @@ PREAMBLE = \ """ - #include + #include """ INITIALIZE = \ """ - komrade::host_vector<$InputType> h_input = komradetest::random_integers<$InputType>($InputSize); + thrust::host_vector<$InputType> h_input = thrusttest::random_integers<$InputType>($InputSize); // increase likelihood of equal consecutive elements for(size_t i = 0; i < $InputSize; i++) h_input[i] %= 4; - komrade::device_vector<$InputType> d_input = h_input; - komrade::device_vector<$InputType> d_copy = d_input; + thrust::device_vector<$InputType> d_input = h_input; + thrust::device_vector<$InputType> d_copy = d_input; - komrade::host_vector<$InputType>::iterator h_end = komrade::unique(h_input.begin(), h_input.end()); - komrade::device_vector<$InputType>::iterator d_end = komrade::unique(d_input.begin(), d_input.end()); + thrust::host_vector<$InputType>::iterator h_end = thrust::unique(h_input.begin(), h_input.end()); + thrust::device_vector<$InputType>::iterator d_end = thrust::unique(d_input.begin(), d_input.end()); - komrade::host_vector<$InputType> h_result(h_input.begin(), h_end); - komrade::device_vector<$InputType> d_result(d_input.begin(), d_end); + thrust::host_vector<$InputType> h_result(h_input.begin(), h_end); + thrust::device_vector<$InputType> d_result(d_input.begin(), d_end); ASSERT_EQUAL(h_result, d_result); """ TIME = \ """ - komrade::copy(d_copy.begin(), d_copy.end(), d_input.begin()); - komrade::unique(d_input.begin(), d_input.end()); + thrust::copy(d_copy.begin(), d_copy.end(), d_input.begin()); + thrust::unique(d_input.begin(), d_input.end()); """ FINALIZE = \