Use heuristic to select histogram node, avoid rabit call (#4951)

This commit is contained in:
Rory Mitchell
2019-10-18 11:33:54 +13:00
committed by GitHub
parent 185e3f1916
commit 60748b2071
2 changed files with 8 additions and 33 deletions

19
tests/cpp/common/test_device_helpers.cu Normal file → Executable file
View File

@@ -84,22 +84,3 @@ void TestAllocator() {
TEST(bulkAllocator, Test) {
TestAllocator();
}
// Test thread safe max reduction
#if defined(XGBOOST_USE_NCCL)
TEST(AllReducer, MGPU_HostMaxAllReduce) {
dh::AllReducer reducer;
size_t num_threads = 50;
std::vector<std::vector<size_t>> thread_data(num_threads);
#pragma omp parallel num_threads(num_threads)
{
int tid = omp_get_thread_num();
thread_data[tid] = {size_t(tid)};
reducer.HostMaxAllReduce(&thread_data[tid]);
}
for (auto data : thread_data) {
ASSERT_EQ(data.front(), num_threads - 1);
}
}
#endif