Skip to content

Commit c203168

Browse files
minor styling changes with CG
1 parent 3ae1afe commit c203168

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

include/cuco/detail/probing_scheme_base.cuh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
#pragma once
1818

19-
#include <cuco/detail/__config>
20-
2119
#include <cstdint>
2220

2321
namespace cuco {

include/cuco/detail/probing_scheme_impl.inl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,9 @@ __host__ __device__ constexpr auto linear_probing<CGSize, Hash>::operator()(
120120
Extent upper_bound) const noexcept
121121
{
122122
using size_type = typename Extent::value_type;
123+
using cg_type = cooperative_groups::thread_block_tile<cg_size>;
123124
return detail::probing_iterator<Extent>{
124-
cuco::detail::sanitize_hash<size_type>(hash_(probe_key), g) % upper_bound,
125+
cuco::detail::sanitize_hash<cg_type, size_type>(g, hash_(probe_key)) % upper_bound,
125126
cg_size,
126127
upper_bound};
127128
}
@@ -163,8 +164,9 @@ __host__ __device__ constexpr auto double_hashing<CGSize, Hash1, Hash2>::operato
163164
Extent upper_bound) const noexcept
164165
{
165166
using size_type = typename Extent::value_type;
167+
using cg_type = cooperative_groups::thread_block_tile<cg_size>;
166168
return detail::probing_iterator<Extent>{
167-
cuco::detail::sanitize_hash<size_type>(hash1_(probe_key), g) % upper_bound,
169+
cuco::detail::sanitize_hash<cg_type, size_type>(g, hash1_(probe_key)) % upper_bound,
168170
static_cast<size_type>(
169171
(cuco::detail::sanitize_hash<size_type>(hash2_(probe_key)) % (upper_bound / cg_size - 1) +
170172
1) *

include/cuco/detail/utils.cuh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,14 @@ __host__ __device__ constexpr SizeType sanitize_hash(HashType hash) noexcept
123123
/**
124124
* @brief Converts a given hash value and cg_rank, into a valid (positive) size type.
125125
*
126+
* @tparam CG Cooperative group type
126127
* @tparam SizeType The target type
127128
* @tparam HashType The input type
128-
* @tparam CG Cooperative group type
129129
*
130130
* @return Converted hash value
131131
*/
132-
template <typename SizeType, typename HashType, typename CG>
133-
__host__ __device__ constexpr SizeType sanitize_hash(HashType hash, CG group) noexcept
132+
template <typename CG, typename SizeType, typename HashType>
133+
__device__ constexpr SizeType sanitize_hash(CG const& group, HashType hash) noexcept
134134
{
135135
auto const base_hash = sanitize_hash<SizeType>(hash);
136136
auto const max_size = cuda::std::numeric_limits<SizeType>::max();

0 commit comments

Comments
 (0)