#include #include template void _TestReduceWithLargeTypes(void) { size_t n = (64 * 1024) / sizeof(FixedVector); thrust::host_vector< FixedVector > h_data(n); for(size_t i = 0; i < h_data.size(); i++) h_data[i] = FixedVector(i); thrust::device_vector< FixedVector > d_data = h_data; FixedVector h_result = thrust::reduce(h_data.begin(), h_data.end(), FixedVector(0)); FixedVector d_result = thrust::reduce(d_data.begin(), d_data.end(), FixedVector(0)); ASSERT_EQUAL_QUIET(h_result, d_result); } void TestReduceWithLargeTypes(void) { _TestReduceWithLargeTypes(); _TestReduceWithLargeTypes(); _TestReduceWithLargeTypes(); // XXX these take too long to compile // _TestReduceWithLargeTypes(); // _TestReduceWithLargeTypes(); // _TestReduceWithLargeTypes(); // _TestReduceWithLargeTypes(); // _TestReduceWithLargeTypes(); } DECLARE_UNITTEST(TestReduceWithLargeTypes);