diff --git a/src/objective/aft_obj.cc b/src/objective/aft_obj.cc index 407c97554..e9299dc54 100644 --- a/src/objective/aft_obj.cc +++ b/src/objective/aft_obj.cc @@ -16,6 +16,6 @@ DMLC_REGISTRY_FILE_TAG(aft_obj); } // namespace obj } // namespace xgboost -#ifndef XGBOOST_USE_CUDA +#if !defined(XGBOOST_USE_CUDA) && !defined(XGBOOST_USE_HIP) #include "aft_obj.cu" #endif // XGBOOST_USE_CUDA diff --git a/src/objective/aft_obj.cu b/src/objective/aft_obj.cu index 52a58a7f4..9c34b827a 100644 --- a/src/objective/aft_obj.cu +++ b/src/objective/aft_obj.cu @@ -28,9 +28,9 @@ using AFTLoss = xgboost::common::AFTLoss; namespace xgboost { namespace obj { -#if defined(XGBOOST_USE_CUDA) +#if defined(XGBOOST_USE_CUDA) || !defined(XGBOOST_USE_HIP) DMLC_REGISTRY_FILE_TAG(aft_obj_gpu); -#endif // defined(XGBOOST_USE_CUDA) +#endif // defined(XGBOOST_USE_CUDA) || !defined(XGBOOST_USE_HIP) class AFTObj : public ObjFunction { public: diff --git a/src/objective/aft_obj.hip b/src/objective/aft_obj.hip index e69de29bb..6df5878b9 100644 --- a/src/objective/aft_obj.hip +++ b/src/objective/aft_obj.hip @@ -0,0 +1,4 @@ + +#if !defined(XGBOOST_USE_HIP) +#include "aft_obj.cu" +#endif