Skip to content

Commit

Permalink
Fix a bug: sync before return
Browse files Browse the repository at this point in the history
  • Loading branch information
PointKernel committed Nov 16, 2023
1 parent 24f3bad commit 9b8ad2e
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -466,8 +466,9 @@ class open_addressing_ref_impl {
#if __CUDA_ARCH__ < 700
// Spinning to ensure that the write to the value part took place requires
// independent thread scheduling introduced with the Volta architecture.
static_assert(cuco::detail::is_packable<value_type>(),
"insert_and_find is not supported for unpackable data on pre-Volta GPUs.");
static_assert(
cuco::detail::is_packable<value_type>(),
"insert_and_find is not supported for pair types larger than 8 bytes on pre-Volta GPUs.");
#endif

auto const key = this->extract_key(value);
Expand Down Expand Up @@ -510,6 +511,7 @@ class open_addressing_ref_impl {
this->wait_for_payload(slot_ptr->second, this->empty_slot_sentinel_.second);
}
}
group.sync();
return {iterator{reinterpret_cast<value_type*>(res)}, false};
}

Expand All @@ -535,6 +537,7 @@ class open_addressing_ref_impl {
this->wait_for_payload(slot_ptr->second, this->empty_slot_sentinel_.second);
}
}
group.sync();
return {iterator{reinterpret_cast<value_type*>(res)}, true};
}
case insert_result::DUPLICATE: {
Expand All @@ -544,6 +547,7 @@ class open_addressing_ref_impl {
this->wait_for_payload(slot_ptr->second, this->empty_slot_sentinel_.second);
}
}
group.sync();
return {iterator{reinterpret_cast<value_type*>(res)}, false};
}
default: continue;
Expand Down

0 comments on commit 9b8ad2e

Please sign in to comment.