From 6eba0a56ec50cbf78c0eccd52df4def57a1f1026 Mon Sep 17 00:00:00 2001 From: amdsc21 <96135754+amdsc21@users.noreply.github.com> Date: Thu, 9 Mar 2023 18:57:14 +0100 Subject: [PATCH] fix CMakeLists.txt --- CMakeLists.txt | 1 + src/metric/elementwise_metric.cu | 1 + 2 files changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 75e1a24b7..df520dff4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -198,6 +198,7 @@ if (USE_HIP) set(CMAKE_HIP_FLAGS "${CMAKE_HIP_FLAGS} -I${HIP_INCLUDE_DIRS} -I${HIP_INCLUDE_DIRS}/hip") set(CMAKE_HIP_FLAGS "${CMAKE_HIP_FLAGS} -Wunused-result") + set(CMAKE_HIP_FLAGS "${CMAKE_HIP_FLAGS} -D__HIP_PLATFORM_AMD__") add_subdirectory(${PROJECT_SOURCE_DIR}/rocgputreeshap) set(BUILD_WITH_HIP_CUB ON) diff --git a/src/metric/elementwise_metric.cu b/src/metric/elementwise_metric.cu index aab1e7a95..f425d8432 100644 --- a/src/metric/elementwise_metric.cu +++ b/src/metric/elementwise_metric.cu @@ -97,6 +97,7 @@ PackedReduceResult Reduce(Context const* ctx, MetaInfo const& info, Fn&& loss) { dh::XGBCachingDeviceAllocator alloc; thrust::counting_iterator begin(0); thrust::counting_iterator end = begin + labels.Size(); + result = thrust::transform_reduce( thrust::hip::par(alloc), begin, end, [=] XGBOOST_DEVICE(size_t i) {