Skip to content

Commit 475c5e4

Browse files
committed
Replace deprecated thrust::identity type
The `thrust::identity` was deprecated and subsequently removed in CCCL 3.0 which ships with CUDA 13.0. Thus, our use of this type blocks us from switching to CUDA 13.0. This commit amends this problem by switching to a custom function object.
1 parent 30b2c9b commit 475c5e4

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

device/cuda/src/ambiguity_resolution/greedy_ambiguity_resolution_algorithm.cu

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@
3939
#include <thrust/unique.h>
4040
namespace traccc::cuda {
4141

42+
struct identity_op {
43+
template <typename T>
44+
TRACCC_HOST_DEVICE T operator()(T i) const {
45+
return i;
46+
}
47+
};
48+
4249
// Device operator to calculate relative number of shared measurements
4350
struct devide_op {
4451
TRACCC_HOST_DEVICE
@@ -200,7 +207,7 @@ greedy_ambiguity_resolution_algorithm::operator()(
200207
auto cit_begin = thrust::counting_iterator<int>(0);
201208
auto cit_end = cit_begin + n_tracks;
202209
thrust::copy_if(thrust_policy, cit_begin, cit_end, status_buffer.ptr(),
203-
pre_accepted_ids_buffer.ptr(), thrust::identity<int>());
210+
pre_accepted_ids_buffer.ptr(), identity_op{});
204211

205212
// Sort the flat measurement id vector
206213
thrust::sort(thrust_policy, flat_meas_ids_buffer.ptr(),

0 commit comments

Comments
 (0)