Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Commit

Permalink
♻️ use thrust::unique_count
Browse files Browse the repository at this point in the history
  • Loading branch information
codereport authored Feb 8, 2024
1 parent 756c5af commit 5943254
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions examples/mode.cu
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>(),
thrust::not_equal_to<int>()) + 1;
size_t num_unique = thrust::unique_count(d_data.begin(), d_data.end());

// count multiplicity of each key
thrust::device_vector<int> d_output_keys(num_unique);
Expand Down

0 comments on commit 5943254

Please sign in to comment.