#include #include #include template void _TestStableSortWithLargeKeys(void) { size_t n = (128 * 1024) / sizeof(FixedVector); thrust::host_vector< FixedVector > h_keys(n); for(size_t i = 0; i < n; i++) // XXX Use proper random number generation facility. h_keys[i] = FixedVector(rand()); thrust::device_vector< FixedVector > d_keys = h_keys; thrust::stable_sort(h_keys.begin(), h_keys.end()); thrust::stable_sort(d_keys.begin(), d_keys.end()); ASSERT_EQUAL_QUIET(h_keys, d_keys); } void TestStableSortWithLargeKeys(void) { _TestStableSortWithLargeKeys(); _TestStableSortWithLargeKeys(); _TestStableSortWithLargeKeys(); _TestStableSortWithLargeKeys(); _TestStableSortWithLargeKeys(); _TestStableSortWithLargeKeys(); _TestStableSortWithLargeKeys(); _TestStableSortWithLargeKeys(); _TestStableSortWithLargeKeys(); // XXX these take too long to compile // _TestStableSortWithLargeKeys(); // _TestStableSortWithLargeKeys(); // _TestStableSortWithLargeKeys(); // _TestStableSortWithLargeKeys(); // _TestStableSortWithLargeKeys(); } DECLARE_UNITTEST(TestStableSortWithLargeKeys);