Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

47 lines (36 sloc) 1.068 kB
PREAMBLE = \
"""
#include <thrust/sort.h>
template <typename T>
struct my_less : public thrust::binary_function<T,T,bool>
{
bool operator()(const T& a, const T& b) const
{
return a < b;
}
};
"""
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;
typedef my_less<$KeyType> Comp;
// test sort
thrust::sort(h_keys.begin(), h_keys.end(), Comp());
thrust::sort(d_keys.begin(), d_keys.end(), Comp());
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(), Comp());
"""
FINALIZE = \
"""
RECORD_TIME();
RECORD_SORTING_RATE(double($InputSize));
"""
KeyTypes = ['int']
InputSizes = [2**24]
TestVariables = [('KeyType', KeyTypes), ('InputSize', InputSizes)]
Jump to Line
Something went wrong with that request. Please try again.