From 9ddf3dd4dc649cc2dc8e25f4a7fda1d9151b4d2b Mon Sep 17 00:00:00 2001 From: fis Date: Fri, 29 Oct 2021 14:50:22 +0800 Subject: [PATCH] win build. --- src/common/device_helpers.cuh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/common/device_helpers.cuh b/src/common/device_helpers.cuh index 50a5d9094d85..ee0621c65085 100644 --- a/src/common/device_helpers.cuh +++ b/src/common/device_helpers.cuh @@ -1462,15 +1462,23 @@ void DeviceSegmentedRadixSortPair( int32_t>; CHECK_LE(num_items, std::numeric_limits::max()); // For Thrust >= 1.12 or CUDA >= 11.4, we require system cub installation + +#if (THRUST_MAJOR_VERSION == 1 && THRUST_MINOR_VERSION >= 13) || THRUST_MAJOR_VERSION > 1 + safe_cuda((cub::DispatchSegmentedRadixSort< + descending, KeyT, ValueT, BeginOffsetIteratorT, EndOffsetIteratorT, + OffsetT>::Dispatch(d_temp_storage, temp_storage_bytes, d_keys, + d_values, num_items, num_segments, + d_begin_offsets, d_end_offsets, begin_bit, + end_bit, false, nullptr, false))); +#else safe_cuda((cub::DispatchSegmentedRadixSort< descending, KeyT, ValueT, BeginOffsetIteratorT, -#if (THRUST_MAJOR_VERSION == 1 && THRUST_MINOR_VERSION >= 13) || THRUST_MAJOR_VERSION > 1 - EndOffsetIteratorT, -#endif OffsetT>::Dispatch(d_temp_storage, temp_storage_bytes, d_keys, d_values, num_items, num_segments, d_begin_offsets, d_end_offsets, begin_bit, end_bit, false, nullptr, false))); +#endif + } } // namespace detail