fix CAPI BuildInfo
This commit is contained in:
@@ -17,8 +17,11 @@ namespace xgboost {
|
||||
void XGBBuildInfoDevice(Json *p_info) {
|
||||
auto &info = *p_info;
|
||||
|
||||
#if defined(XGBOOST_USE_CUDA)
|
||||
info["USE_CUDA"] = true;
|
||||
#elif defined(XGBOOST_USE_HIP)
|
||||
info["USE_HIP"] = true;
|
||||
#endif
|
||||
|
||||
std::vector<Json> v{Json{Integer{THRUST_MAJOR_VERSION}}, Json{Integer{THRUST_MINOR_VERSION}},
|
||||
Json{Integer{THRUST_SUBMINOR_VERSION}}};
|
||||
@@ -29,6 +32,9 @@ void XGBBuildInfoDevice(Json *p_info) {
|
||||
|
||||
#if defined(XGBOOST_USE_NCCL)
|
||||
info["USE_NCCL"] = Boolean{true};
|
||||
v = {Json{Integer{NCCL_MAJOR}}, Json{Integer{NCCL_MINOR}}, Json{Integer{NCCL_PATCH}}};
|
||||
info["NCCL_VERSION"] = v;
|
||||
#elif defined(XGBOOST_USE_RCCL)
|
||||
info["USE_RCCL"] = Boolean{true};
|
||||
v = {Json{Integer{NCCL_MAJOR}}, Json{Integer{NCCL_MINOR}}, Json{Integer{NCCL_PATCH}}};
|
||||
info["NCCL_VERSION"] = v;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "device_communicator.cuh"
|
||||
#include "device_communicator_adapter.cuh"
|
||||
#include "noop_communicator.h"
|
||||
#ifdef XGBOOST_USE_NCCL
|
||||
#if defined(XGBOOST_USE_NCCL) || defined(XGBOOST_USE_RCCL)
|
||||
#include "nccl_device_communicator.cuh"
|
||||
#endif
|
||||
|
||||
@@ -25,7 +25,7 @@ void Communicator::Finalize() {
|
||||
DeviceCommunicator* Communicator::GetDevice(int device_ordinal) {
|
||||
if (!device_communicator_ || device_ordinal_ != device_ordinal) {
|
||||
device_ordinal_ = device_ordinal;
|
||||
#ifdef XGBOOST_USE_NCCL
|
||||
#if defined(XGBOOST_USE_NCCL) || defined(XGBOOST_USE_RCCL)
|
||||
if (type_ != CommunicatorType::kFederated) {
|
||||
device_communicator_.reset(new NcclDeviceCommunicator(device_ordinal, Get()));
|
||||
} else {
|
||||
|
||||
@@ -38,9 +38,9 @@
|
||||
#include "xgboost/logging.h"
|
||||
#include "xgboost/span.h"
|
||||
|
||||
#ifdef XGBOOST_USE_NCCL
|
||||
#include "nccl.h"
|
||||
#endif // XGBOOST_USE_NCCL
|
||||
#ifdef XGBOOST_USE_RCCL
|
||||
#include "rccl.h"
|
||||
#endif // XGBOOST_USE_RCCL
|
||||
|
||||
#if defined(XGBOOST_USE_RMM) && XGBOOST_USE_RMM == 1
|
||||
#include "rmm/mr/device/per_device_resource.hpp"
|
||||
|
||||
Reference in New Issue
Block a user