Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
37 lines (27 sloc) 850 Bytes
PREAMBLE = \
"""
#include <thrust/sort.h>
#include <algorithm>
"""
INITIALIZE = \
"""
thrust::host_vector<$KeyType> h_keys = unittest::random_integers<$KeyType>($InputSize);
thrust::host_vector<$KeyType> h_keys_copy(h_keys);
// test sort
$Sort(h_keys.begin(), h_keys.end());
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());
"""
FINALIZE = \
"""
RECORD_TIME();
RECORD_SORTING_RATE(double($InputSize));
"""
KeyTypes = ['int']
InputSizes = [2**20]
Sorts = ['thrust::sort', 'thrust::stable_sort', 'std::sort', 'std::stable_sort']
TestVariables = [('KeyType', KeyTypes), ('InputSize', InputSizes), ('Sort', Sorts)]
Something went wrong with that request. Please try again.