Skip to content

Commit

Permalink
Fix CAS dispatching bug (#533)
Browse files Browse the repository at this point in the history
This PR fixes a macro typo when dispatching the between back-to-back CAS
and CAS-dependent write.
  • Loading branch information
PointKernel authored Jul 9, 2024
1 parent 687948a commit 63d313e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <cuco/probing_scheme.cuh>

#include <cuda/atomic>
#include <cuda/std/type_traits>
#include <thrust/distance.h>
#include <thrust/tuple.h>
#if defined(CUCO_HAS_CUDA_BARRIER)
Expand Down Expand Up @@ -1345,7 +1346,7 @@ class open_addressing_ref_impl {
value_type const& expected,
Value const& desired) noexcept
{
using mapped_type = decltype(this->empty_value_sentinel());
using mapped_type = cuda::std::decay_t<decltype(this->empty_value_sentinel())>;

auto const expected_key = expected.first;
auto const expected_payload = expected.second;
Expand Down Expand Up @@ -1437,7 +1438,7 @@ class open_addressing_ref_impl {
if constexpr (sizeof(value_type) <= 8) {
return packed_cas(address, expected, desired);
} else {
#if (_CUDA_ARCH__ < 700)
#if (__CUDA_ARCH__ < 700)
return cas_dependent_write(address, expected, desired);
#else
return back_to_back_cas(address, expected, desired);
Expand Down
2 changes: 1 addition & 1 deletion include/cuco/detail/static_map.inl
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ __device__ bool static_map<Key, Value, Scope, Allocator>::device_mutable_view::i
}

if constexpr (not cuco::detail::is_packable<value_type>()) {
#if (_CUDA_ARCH__ < 700)
#if (__CUDA_ARCH__ < 700)
return cas_dependent_write(current_slot, insert_pair, key_equal, existing_key);
#else
return back_to_back_cas(current_slot, insert_pair, key_equal, existing_key);
Expand Down

0 comments on commit 63d313e

Please sign in to comment.