From b0dacc5a800879f7a5f2166cb16b983fd7132a80 Mon Sep 17 00:00:00 2001 From: amdsc21 <96135754+amdsc21@users.noreply.github.com> Date: Sat, 11 Mar 2023 03:47:23 +0100 Subject: [PATCH] fix bug --- src/common/survival_util.h | 4 ++-- src/metric/metric.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/survival_util.h b/src/common/survival_util.h index e891edb54..c5f134fc1 100644 --- a/src/common/survival_util.h +++ b/src/common/survival_util.h @@ -25,12 +25,12 @@ DECLARE_FIELD_ENUM_CLASS(xgboost::common::ProbabilityDistributionType); namespace xgboost { namespace common { -#ifndef __CUDACC__ +#if !defined(__CUDACC__) && !defined(__HIP_PLATFORM_AMD__) using std::log; using std::fmax; -#endif // __CUDACC__ +#endif // __CUDACC__ && __HIP_PLATFORM_AMD__ enum class CensoringType : uint8_t { kUncensored, kRightCensored, kLeftCensored, kIntervalCensored diff --git a/src/metric/metric.cc b/src/metric/metric.cc index ebb579827..2b805185c 100644 --- a/src/metric/metric.cc +++ b/src/metric/metric.cc @@ -84,7 +84,7 @@ DMLC_REGISTRY_LINK_TAG(elementwise_metric); DMLC_REGISTRY_LINK_TAG(multiclass_metric); DMLC_REGISTRY_LINK_TAG(survival_metric); DMLC_REGISTRY_LINK_TAG(rank_metric); -#ifdef XGBOOST_USE_CUDA +#if defined(XGBOOST_USE_CUDA) || defined(XGBOOST_USE_HIP) DMLC_REGISTRY_LINK_TAG(auc_gpu); DMLC_REGISTRY_LINK_TAG(rank_metric_gpu); #endif