Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 36 lines (28 sloc) 1.033 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
PREAMBLE = \
    """
    #include <thrust/sort.h>
    #include <thrust/detail/backend/cuda/detail/stable_radix_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::stable_sort(h_keys.begin(), h_keys.end());
    thrust::detail::backend::cuda::detail::stable_radix_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::detail::backend::cuda::detail::stable_radix_sort(d_keys.begin(), d_keys.end());
    """

FINALIZE = \
    """
    RECORD_TIME();
    RECORD_SORTING_RATE(double($InputSize));
    """


KeyTypes = ['char', 'short', 'int', 'long', 'float', 'double']
InputSizes = [2**N for N in range(18, 25)]

TestVariables = [('KeyType', KeyTypes), ('InputSize', InputSizes)]
Something went wrong with that request. Please try again.