Loop over thrust::reduce. (#6229)

* Check input chunk size of dqdm.
* Add doc for current limitation.
This commit is contained in:
Jiaming Yuan
2020-10-14 05:40:56 +08:00
committed by GitHub
parent 734a911a26
commit bed7ae4083
10 changed files with 46 additions and 8 deletions

View File

@@ -1,4 +1,3 @@
/*!
* Copyright 2017 XGBoost contributors
*/
@@ -122,6 +121,14 @@ void TestSegmentedUniqueRegression(std::vector<SketchEntry> values, size_t n_dup
ASSERT_EQ(segments.at(1), d_segments_out[1] + n_duplicated);
}
TEST(DeviceHelpers, Reduce) {
size_t kSize = std::numeric_limits<uint32_t>::max();
auto it = thrust::make_counting_iterator(0ul);
dh::XGBCachingDeviceAllocator<char> alloc;
auto batched = dh::Reduce(thrust::cuda::par(alloc), it, it + kSize, 0ul, thrust::maximum<size_t>{});
CHECK_EQ(batched, kSize - 1);
}
TEST(SegmentedUnique, Regression) {
{