Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
37 lines (27 sloc) 818 Bytes
PREAMBLE = \
"""
#include <thrust/sort.h>
"""
INITIALIZE = \
"""
thrust::host_vector<$KeyType> h_keys = unittest::random_integers<$KeyType>($InputSize);
thrust::device_vector<$KeyType> d_keys = h_keys;
thrust::device_vector<$KeyType> d_keys_copy = d_keys;
// test sort
thrust::sort(h_keys.begin(), h_keys.end());
thrust::sort(d_keys.begin(), d_keys.end());
ASSERT_EQUAL(d_keys, h_keys);
"""
TIME = \
"""
thrust::copy(d_keys_copy.begin(), d_keys_copy.end(), d_keys.begin());
thrust::sort(d_keys.begin(), d_keys.end());
"""
FINALIZE = \
"""
RECORD_TIME();
RECORD_SORTING_RATE(double($InputSize));
"""
KeyTypes = SignedIntegerTypes
InputSizes = StandardSizes
TestVariables = [('KeyType', KeyTypes), ('InputSize', InputSizes)]
Something went wrong with that request. Please try again.