Remove MGPU cpp tests. (#8276)

Co-authored-by: Hyunsu Philip Cho <chohyu01@cs.washington.edu>
This commit is contained in:
Jiaming Yuan
2022-09-27 21:18:23 +08:00
committed by GitHub
parent fcab51aa82
commit 6d1452074a
10 changed files with 52 additions and 104 deletions

View File

@@ -1,11 +1,17 @@
/*!
* Copyright 2018 XGBoost contributors
* Copyright 2018-2022 XGBoost contributors
*/
#include "common.h"
namespace xgboost {
namespace common {
void SetDevice(std::int32_t device) {
if (device >= 0) {
dh::safe_cuda(cudaSetDevice(device));
}
}
int AllVisibleGPUs() {
int n_visgpus = 0;
try {

View File

@@ -246,6 +246,16 @@ inline void AssertOneAPISupport() {
#endif // XGBOOST_USE_ONEAPI
}
void SetDevice(std::int32_t device);
#if !defined(XGBOOST_USE_CUDA)
inline void SetDevice(std::int32_t device) {
if (device >= 0) {
AssertGPUSupport();
}
}
#endif
template <typename Idx, typename Container,
typename V = typename Container::value_type,
typename Comp = std::less<V>>