From f703c01043928672d18fd501b1c8cc69cda43939 Mon Sep 17 00:00:00 2001 From: Jared Hoberock Date: Tue, 26 Oct 2010 13:36:19 -0700 Subject: [PATCH] Report sorting rate in merge.test Add an entry to report.py for merge.xml --- performance/merge.test | 15 ++++++++------- performance/report.py | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/performance/merge.test b/performance/merge.test index 49e7327a0..1e158ec4e 100644 --- a/performance/merge.test +++ b/performance/merge.test @@ -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); @@ -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)] diff --git a/performance/report.py b/performance/report.py index b22eeefd3..2436c3ab2 100644 --- a/performance/report.py +++ b/performance/report.py @@ -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']: