Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
37 lines (27 sloc) 898 Bytes
PREAMBLE = \
"""
#include <thrust/sort.h>
"""
INITIALIZE = \
"""
thrust::host_vector<$KeyType> h_keys = unittest::random_integers<$KeyType>($InputSize);
thrust::host_vector<$KeyType> h_keys_copy(h_keys);
thrust::host_vector<$KeyType> h_values($InputSize);
// test sort
$Sort(h_keys.begin(), h_keys.end(), h_values.begin());
ASSERT_EQUAL(thrust::is_sorted(h_keys.begin(), h_keys.end()), true);
"""
TIME = \
"""
thrust::copy(h_keys_copy.begin(), h_keys_copy.end(), h_keys.begin());
$Sort(h_keys.begin(), h_keys.end(), h_values.begin());
"""
FINALIZE = \
"""
RECORD_TIME();
RECORD_SORTING_RATE(double($InputSize));
"""
KeyTypes = ['int']
InputSizes = [2**20]
Sorts = ['thrust::sort_by_key', 'thrust::stable_sort_by_key']
TestVariables = [('KeyType', KeyTypes), ('InputSize', InputSizes), ('Sort', Sorts)]
Jump to Line
Something went wrong with that request. Please try again.