Skip to content

Commit

Permalink
Rename merge_sort_by_key.test to comparison_sort_by_key.test and elim…
Browse files Browse the repository at this point in the history
…inate the use of a detail namespace.
  • Loading branch information
jaredhoberock authored and vamatya committed Feb 22, 2013
1 parent b6614e2 commit f003175
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ PREAMBLE = \
"""
#include <thrust/sort.h>
#include <thrust/sequence.h>
template<typename T>
struct my_less
{
inline __host__ __device__
bool operator()(const T &lhs, const T &rhs) const
{
return lhs < rhs;
}
};
"""

INITIALIZE = \
Expand All @@ -18,7 +27,8 @@ INITIALIZE = \

// test sort
thrust::stable_sort_by_key(h_keys.begin(), h_keys.end(), h_values.begin());
thrust::detail::backend::cuda::detail::stable_merge_sort_by_key(d_keys.begin(), d_keys.end(), d_values.begin(), thrust::less<$KeyType>());

thrust::stable_sort_by_key(d_keys.begin(), d_keys.end(), d_values.begin(), my_less<$KeyType>());

ASSERT_EQUAL(d_keys, h_keys);
ASSERT_EQUAL(d_values, h_values);
Expand All @@ -27,7 +37,7 @@ INITIALIZE = \
TIME = \
"""
thrust::copy(d_keys_copy.begin(), d_keys_copy.end(), d_keys.begin());
thrust::detail::backend::cuda::detail::stable_merge_sort_by_key(d_keys.begin(), d_keys.end(), d_values.begin(), thrust::less<$KeyType>());
thrust::stable_sort_by_key(d_keys.begin(), d_keys.end(), d_values.begin(), my_less<$KeyType>());
"""

FINALIZE = \
Expand Down
2 changes: 1 addition & 1 deletion performance/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
for method in ['indirect_sort']:
output(method + '.xml', 'Sort', 'VectorLength', 'Time', plot='semilogx', title='Indirect Sorting', format=format)

for method in ['sort', 'merge_sort', 'radix_sort']:
for method in ['sort', 'comparison_sort', 'radix_sort']:
output(method + '.xml', 'KeyType', 'InputSize', 'Sorting', title='thrust::' + method, format=format)
output(method + '_by_key.xml', 'KeyType', 'InputSize', 'Sorting', title='thrust::' + method + '_by_key', format=format)

Expand Down

0 comments on commit f003175

Please sign in to comment.