Use heuristic to select histogram node, avoid rabit call (#4951)
This commit is contained in:
19
tests/cpp/common/test_device_helpers.cu
Normal file → Executable file
19
tests/cpp/common/test_device_helpers.cu
Normal file → Executable 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
|
||||
|
||||
Reference in New Issue
Block a user