Skip to content

Commit

Permalink
Replace "komrade" with "thrust" in performance/
Browse files Browse the repository at this point in the history
--HG--
extra : convert_revision : svn%3A83215879-3e5a-4751-8c9d-778f44bb06a5/trunk%4091
  • Loading branch information
jaredhoberock committed May 24, 2009
1 parent a6711ae commit cab9eff
Show file tree
Hide file tree
Showing 16 changed files with 117 additions and 117 deletions.
2 changes: 1 addition & 1 deletion performance/build/test_function_template.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion performance/build/test_program_template.cxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <komradetest/unittest.h>
#include <thrusttest/unittest.h>

/*********** BEGIN PREAMBLE SECTION ***********/
$PREAMBLE
Expand Down
12 changes: 6 additions & 6 deletions performance/fill.test
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
PREAMBLE = \
"""
#include <komrade/fill.h>
#include <thrust/fill.h>
"""

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 = \
Expand Down
16 changes: 8 additions & 8 deletions performance/inclusive_scan.test
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
PREAMBLE = \
"""
#include <komrade/scan.h>
#include <thrust/scan.h>
"""

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 = \
Expand Down
16 changes: 8 additions & 8 deletions performance/inner_product.test
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
PREAMBLE = \
"""
#include <komrade/inner_product.h>
#include <thrust/inner_product.h>
"""

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 = \
Expand Down
16 changes: 8 additions & 8 deletions performance/merge_sort.test
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
PREAMBLE = \
"""
#include <komrade/sorting/merge_sort.h>
#include <thrust/sorting/merge_sort.h>
"""

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 = \
Expand Down
26 changes: 13 additions & 13 deletions performance/merge_sort_by_key.test
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
PREAMBLE = \
"""
#include <komrade/sorting/merge_sort.h>
#include <komrade/range.h>
#include <thrust/sorting/merge_sort.h>
#include <thrust/range.h>
"""

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);
"""

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 = \
Expand Down
16 changes: 8 additions & 8 deletions performance/radix_sort.test
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
PREAMBLE = \
"""
#include <komrade/sorting/radix_sort.h>
#include <thrust/sorting/radix_sort.h>
"""

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 = \
Expand Down
26 changes: 13 additions & 13 deletions performance/radix_sort_by_key.test
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
PREAMBLE = \
"""
#include <komrade/sorting/radix_sort.h>
#include <komrade/range.h>
#include <thrust/sorting/radix_sort.h>
#include <thrust/range.h>
"""

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);
"""

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 = \
Expand Down
12 changes: 6 additions & 6 deletions performance/reduce.test
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
PREAMBLE = \
"""
#include <komrade/reduce.h>
#include <thrust/reduce.h>
"""

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 = \
Expand Down
8 changes: 4 additions & 4 deletions performance/reduce_float.test
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
PREAMBLE = \
"""
#include <komrade/reduce.h>
#include <thrust/reduce.h>
"""

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;

"""

TIME = \
"""
komrade::reduce(d_input.begin(), d_input.end(), init);
thrust::reduce(d_input.begin(), d_input.end(), init);
"""

FINALIZE = \
Expand Down
4 changes: 2 additions & 2 deletions performance/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -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<float>()', format=format)
plot_results('sort_large.xml', 'KeyType', 'InputSize', 'Sorting', dpi=120, plot='semilogx', title='komrade::sort<T>()', format=format)
plot_results('reduce_float.xml', 'InputType', 'InputSize', 'Bandwidth', dpi=120, plot='semilogx', title='thrust::reduce<float>()', format=format)
plot_results('sort_large.xml', 'KeyType', 'InputSize', 'Sorting', dpi=120, plot='semilogx', title='thrust::sort<T>()', format=format)

16 changes: 8 additions & 8 deletions performance/sort.test
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
PREAMBLE = \
"""
#include <komrade/sort.h>
#include <thrust/sort.h>
"""

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 = \
Expand Down
Loading

0 comments on commit cab9eff

Please sign in to comment.