From 5943254e4cff1ad957b924b72604b485f9f7a29c Mon Sep 17 00:00:00 2001 From: Conor Hoekstra <36027403+codereport@users.noreply.github.com> Date: Thu, 8 Feb 2024 10:50:09 -0500 Subject: [PATCH] :recycle: use thrust::unique_count --- examples/mode.cu | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/examples/mode.cu b/examples/mode.cu index 2069adec1..48bbeb9f0 100644 --- a/examples/mode.cu +++ b/examples/mode.cu @@ -46,11 +46,7 @@ int main(void) std::cout << std::endl; // count number of unique keys - size_t num_unique = thrust::inner_product(d_data.begin(), d_data.end() - 1, - d_data.begin() + 1, - 0, - thrust::plus(), - thrust::not_equal_to()) + 1; + size_t num_unique = thrust::unique_count(d_data.begin(), d_data.end()); // count multiplicity of each key thrust::device_vector d_output_keys(num_unique);