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) {