Add multi-GPU unit test environment (#3741)
* Add multi-GPU unit test environment * Better assertion message * Temporarily disable failing test * Distinguish between multi-GPU and single-GPU CPP tests * Consolidate Python tests. Use attributes to distinguish multi-GPU Python tests from single-CPU counterparts
This commit is contained in:
committed by
GitHub
parent
baef5741df
commit
b50bc2c1d4
@@ -10,6 +10,7 @@
|
||||
#include "../../../src/data/sparse_page_source.h"
|
||||
#include "../../../src/gbm/gbtree_model.h"
|
||||
#include "../../../src/tree/updater_gpu_hist.cu"
|
||||
#include "../../../src/common/common.h"
|
||||
|
||||
namespace xgboost {
|
||||
namespace tree {
|
||||
@@ -88,5 +89,15 @@ TEST(gpu_hist_experimental, TestDenseShard) {
|
||||
delete dmat;
|
||||
}
|
||||
|
||||
TEST(gpu_hist_experimental, MGPU_mock) {
|
||||
// Attempt to choose multiple GPU devices
|
||||
int ngpu;
|
||||
dh::safe_cuda(cudaGetDeviceCount(&ngpu));
|
||||
CHECK_GT(ngpu, 1);
|
||||
for (int i = 0; i < ngpu; ++i) {
|
||||
dh::safe_cuda(cudaSetDevice(i));
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace tree
|
||||
} // namespace xgboost
|
||||
|
||||
Reference in New Issue
Block a user