diff --git a/src/common/cuda_context.cuh b/src/common/cuda_context.cuh index b7119ef90e6a..8fc22f72131b 100644 --- a/src/common/cuda_context.cuh +++ b/src/common/cuda_context.cuh @@ -18,9 +18,9 @@ struct CUDAContext { */ auto CTP() const { #if THRUST_MAJOR_VERSION >= 2 - return thrust::cuda::par_nosync(caching_alloc_).on(dh::DefaultStream()); + return thrust::system::hip::par_nosync(caching_alloc_).on(dh::DefaultStream()); #else - return thrust::cuda::par(caching_alloc_).on(dh::DefaultStream()); + return thrust::system::hip::par(caching_alloc_).on(dh::DefaultStream()); #endif // THRUST_MAJOR_VERSION >= 2 } /** @@ -28,9 +28,9 @@ struct CUDAContext { */ auto TP() const { #if THRUST_MAJOR_VERSION >= 2 - return thrust::cuda::par_nosync(alloc_).on(dh::DefaultStream()); + return thrust::system::hip::par_nosync(alloc_).on(dh::DefaultStream()); #else - return thrust::cuda::par(alloc_).on(dh::DefaultStream()); + return thrust::system::hip::par(alloc_).on(dh::DefaultStream()); #endif // THRUST_MAJOR_VERSION >= 2 } auto Stream() const { return dh::DefaultStream(); } diff --git a/src/common/device_helpers.hip.h b/src/common/device_helpers.hip.h index f59b62ca6ec4..15d94aeea29c 100644 --- a/src/common/device_helpers.hip.h +++ b/src/common/device_helpers.hip.h @@ -888,7 +888,7 @@ template size_t SegmentedUnique(Inputs &&...inputs) { dh::XGBCachingDeviceAllocator alloc; - return SegmentedUnique(thrust::hip::par(alloc), + return SegmentedUnique(thrust::system::hip::par(alloc), std::forward(inputs)..., thrust::equal_to{}); } @@ -988,7 +988,7 @@ void CopyIf(InIt in_first, InIt in_second, OutIt out_first, Predicate pred) { for (size_t offset = 0; offset < length; offset += kMaxCopySize) { auto begin_input = in_first + offset; auto end_input = in_first + std::min(offset + kMaxCopySize, length); - out_first = thrust::copy_if(thrust::hip::par(alloc), begin_input, + out_first = thrust::copy_if(thrust::system::hip::par(alloc), begin_input, end_input, out_first, pred); } } diff --git a/src/common/stats.cuh b/src/common/stats.cuh index 1af89af37f80..8ba131d629c9 100644 --- a/src/common/stats.cuh +++ b/src/common/stats.cuh @@ -217,7 +217,7 @@ void SegmentedWeightedQuantile(Context const* ctx, AlphaIt alpha_it, SegIt seg_b auto scan_val = dh::MakeTransformIterator(thrust::make_counting_iterator(0ul), detail::WeightOp{w_begin, d_sorted_idx}); - thrust::inclusive_scan_by_key(thrust::cuda::par(caching), scan_key, scan_key + n_weights, + thrust::inclusive_scan_by_key(thrust::system::hip::par(caching), scan_key, scan_key + n_weights, scan_val, weights_cdf.begin()); auto n_segments = std::distance(seg_beg, seg_end) - 1; diff --git a/src/metric/elementwise_metric.cu b/src/metric/elementwise_metric.cu index 3acb24b37ea7..c7a828ac4e27 100644 --- a/src/metric/elementwise_metric.cu +++ b/src/metric/elementwise_metric.cu @@ -52,7 +52,7 @@ PackedReduceResult Reduce(Context const* ctx, MetaInfo const& info, Fn&& loss) { thrust::counting_iterator begin(0); thrust::counting_iterator end = begin + labels.Size(); result = thrust::transform_reduce( - thrust::cuda::par(alloc), begin, end, + thrust::system::hip::par(alloc), begin, end, [=] XGBOOST_DEVICE(size_t i) { auto idx = linalg::UnravelIndex(i, labels.Shape()); auto sample_id = std::get<0>(idx);