Skip to content

Commit cc7cce6

Browse files
committed
Misc coding style
1 parent cdbabef commit cc7cce6

3 files changed

Lines changed: 15 additions & 15 deletions

File tree

include/cuco/detail/trie/trie_ref.inl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ class operator_impl<op::trie_lookup_tag, trie_ref<LabelType, Allocator, Operator
5050
/**
5151
* @brief Find position of last child of a node
5252
*
53-
* @param louds louds bitvector of current level
53+
* @param louds louds bitset of current level
5454
* @param node_id node index in current level
5555
*
5656
* @return Position of last child
5757
*/
58-
template <typename BitVectorRef>
59-
[[nodiscard]] __device__ size_type get_last_child_position(BitVectorRef louds,
60-
size_type& node_id) const noexcept
58+
template <typename BitsetRef>
59+
[[nodiscard]] __device__ size_type last_child_position(BitsetRef louds,
60+
size_type& node_id) const noexcept
6161
{
6262
size_type node_pos = 0;
6363
if (node_id != 0) {
@@ -85,7 +85,7 @@ class operator_impl<op::trie_lookup_tag, trie_ref<LabelType, Allocator, Operator
8585
auto const& trie = static_cast<ref_type const&>(*this).trie_;
8686
auto louds = trie->louds_refs_ptr_[level_id];
8787

88-
auto end = get_last_child_position(louds, node_id); // Position of last child
88+
auto end = last_child_position(louds, node_id); // Position of last child
8989
auto begin = node_id; // Position of first child, initialized after find_last_child call
9090

9191
auto& level = trie->d_levels_ptr_[level_id];

include/cuco/trie.cuh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ class trie {
107107
level* d_levels_ptr_; ///< Device-side array of levels
108108

109109
using bitset_ref = detail::dynamic_bitset<>::ref_type; ///< Read ref
110-
thrust::device_vector<bitset_ref> louds_refs_; ///< refs to per-level louds bitvectors
111-
thrust::device_vector<bitset_ref> outs_refs_; ///< refs to per-level outs bitvectors
110+
thrust::device_vector<bitset_ref> louds_refs_; ///< refs to per-level louds bitsets
111+
thrust::device_vector<bitset_ref> outs_refs_; ///< refs to per-level outs bitsets
112112

113113
bitset_ref* louds_refs_ptr_; ///< Raw pointer to d_louds_refs_
114114
bitset_ref* outs_refs_ptr_; ///< Raw pointer to d_outs_refs_

tests/trie/lookup_test.cu

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@
2525
#include <catch2/catch_test_macros.hpp>
2626

2727
struct valid_key {
28-
valid_key(uint64_t num_keys) : num_keys_(num_keys) {}
29-
__host__ __device__ bool operator()(uint64_t x) const { return x < num_keys_; }
30-
const uint64_t num_keys_;
28+
valid_key(size_t num_keys) : num_keys_(num_keys) {}
29+
__host__ __device__ bool operator()(size_t x) const { return x < num_keys_; }
30+
const size_t num_keys_;
3131
};
3232

3333
template <typename KeyType>
3434
void generate_keys(thrust::host_vector<KeyType>& keys,
35-
thrust::host_vector<uint64_t>& offsets,
35+
thrust::host_vector<size_t>& offsets,
3636
size_t num_keys,
3737
size_t max_key_value,
3838
size_t max_key_length)
@@ -58,7 +58,7 @@ TEST_CASE("Lookup test", "")
5858
std::size_t max_key_value = 1000;
5959
std::size_t max_key_length = 32;
6060
thrust::host_vector<KeyType> keys;
61-
thrust::host_vector<uint64_t> offsets;
61+
thrust::host_vector<size_t> offsets;
6262

6363
generate_keys(keys, offsets, num_keys, max_key_value, max_key_length);
6464

@@ -97,9 +97,9 @@ TEST_CASE("Lookup test", "")
9797
trie.build();
9898

9999
{
100-
thrust::device_vector<uint64_t> lookup_result(num_keys, -1lu);
101-
thrust::device_vector<KeyType> device_keys = keys;
102-
thrust::device_vector<uint64_t> device_offsets = offsets;
100+
thrust::device_vector<size_t> lookup_result(num_keys, -1lu);
101+
thrust::device_vector<KeyType> device_keys = keys;
102+
thrust::device_vector<size_t> device_offsets = offsets;
103103

104104
trie.lookup(
105105
device_keys.begin(), device_offsets.begin(), device_offsets.end(), lookup_result.begin());

0 commit comments

Comments
 (0)