Skip to content

Commit

Permalink
Report sorting rate in merge.test
Browse files Browse the repository at this point in the history
Add an entry to report.py for merge.xml
  • Loading branch information
jaredhoberock committed Oct 26, 2010
1 parent 7ebd80f commit f703c01
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
15 changes: 8 additions & 7 deletions performance/merge.test
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ PREAMBLE = \

INITIALIZE = \
"""
thrust::device_vector<$KeyType> d_a = unittest::random_integers<$KeyType>($InputSize);
thrust::device_vector<$KeyType> d_b = unittest::random_integers<$KeyType>($InputSize);
thrust::device_vector<$InputType> d_a = unittest::random_integers<$InputType>($InputSize);
thrust::device_vector<$InputType> d_b = unittest::random_integers<$InputType>($InputSize);
thrust::sort(d_a.begin(), d_a.end());
thrust::sort(d_b.begin(), d_b.end());

thrust::device_vector<$KeyType> d_sorted;
thrust::device_vector<$InputType> d_sorted;
d_sorted.insert(d_sorted.end(), d_a.begin(), d_a.end());
d_sorted.insert(d_sorted.end(), d_b.begin(), d_b.end());
thrust::stable_sort(d_sorted.begin(), d_sorted.end());

thrust::device_vector<$KeyType> d_result(d_a.size() + d_b.size());
thrust::device_vector<$InputType> d_result(d_a.size() + d_b.size());
thrust::merge(d_a.begin(), d_a.end(), d_b.begin(), d_b.end(), d_result.begin());

ASSERT_EQUAL(d_sorted, d_result);
Expand All @@ -30,12 +30,13 @@ TIME = \
FINALIZE = \
"""
RECORD_TIME();
RECORD_BANDWIDTH(4 * sizeof($KeyType) * double($InputSize));
RECORD_BANDWIDTH(4 * sizeof($InputType) * double($InputSize));
RECORD_SORTING_RATE(2 * double($InputSize))
"""


KeyTypes = ['char', 'short', 'int', 'long', 'float', 'double']
InputTypes = ['char', 'short', 'int', 'long', 'float', 'double']
InputSizes = [2**N for N in range(10, 25)]

TestVariables = [('KeyType', KeyTypes), ('InputSize', InputSizes)]
TestVariables = [('InputType', InputTypes), ('InputSize', InputSizes)]

2 changes: 1 addition & 1 deletion performance/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#output = print_results
output = plot_results

for function in ['fill', 'reduce', 'inner_product', 'gather']:
for function in ['fill', 'reduce', 'inner_product', 'gather', 'merge']:
output(function + '.xml', 'InputType', 'InputSize', 'Bandwidth', format=format)

for function in ['inclusive_scan', 'inclusive_segmented_scan', 'unique']:
Expand Down

0 comments on commit f703c01

Please sign in to comment.