Skip to content

Commit

Permalink
Minor cleanup: rename insert_pair as insert_element in common kernel …
Browse files Browse the repository at this point in the history
…implementations
  • Loading branch information
PointKernel committed Sep 14, 2023
1 parent 641c868 commit 91c78d5
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions include/cuco/detail/common_kernels.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,15 @@ __global__ void insert_if_n(InputIterator first,

while (idx < n) {
if (pred(*(stencil + idx))) {
typename Ref::value_type const insert_pair{*(first + idx)};
typename Ref::value_type const insert_element{*(first + idx)};
if constexpr (CGSize == 1) {
if (ref.insert(insert_pair)) { thread_num_successes++; };
if (ref.insert(insert_element)) { thread_num_successes++; };
} else {
auto const tile =
cooperative_groups::tiled_partition<CGSize>(cooperative_groups::this_thread_block());
if (ref.insert(tile, insert_pair) && tile.thread_rank() == 0) { thread_num_successes++; };
if (ref.insert(tile, insert_element) && tile.thread_rank() == 0) {
thread_num_successes++;
};
}
}
idx += loop_stride;
Expand Down Expand Up @@ -134,13 +136,13 @@ __global__ void insert_if_n(

while (idx < n) {
if (pred(*(stencil + idx))) {
typename Ref::value_type const insert_pair{*(first + idx)};
typename Ref::value_type const insert_element{*(first + idx)};
if constexpr (CGSize == 1) {
ref.insert(insert_pair);
ref.insert(insert_element);
} else {
auto const tile =
cooperative_groups::tiled_partition<CGSize>(cooperative_groups::this_thread_block());
ref.insert(tile, insert_pair);
ref.insert(tile, insert_element);
}
}
idx += loop_stride;
Expand Down

0 comments on commit 91c78d5

Please sign in to comment.