Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get rid of get_ prefixes #154

Closed
PointKernel opened this issue May 17, 2022 · 5 comments
Closed

Get rid of get_ prefixes #154

PointKernel opened this issue May 17, 2022 · 5 comments
Assignees
Labels
good first issue Good for newcomers P2: Nice to have Desired, but not necessary type: feature request New feature request

Comments

@PointKernel
Copy link
Member

We should rename APIs like static_map::get_size() to static_map::size() to align with the common naming practice in libcudf. The get_ prefix is unnecessary.

@vighnesh-kadam
Copy link

Can you please assign me the issue ? I'm interested!

@PointKernel
Copy link
Member Author

@vighnesh-kadam Sure. Thanks for helping out!

@vighnesh-kadam
Copy link

I tried searching for the API "static_map::get_size()" and also searched similar using regex but could not find them . All i found were of the type "state.get_int64("NumInputs");"
Can you guide me how i should proceed with this?

@PointKernel
Copy link
Member Author

@vighnesh-kadam One way you can do it is to go to the cuCollections/include/cuco directory and look for get_.
Here is what I got via grep -rn "get_" :

(base) yunsongw@yunsongw-dt:~/Work/cuCollections/include/cuco$ grep -rn "get_"
static_multimap.cuh:125: * kernel<<<...>>>(m.get_device_view());
static_multimap.cuh:591:    __device__ __forceinline__ pair_atomic_type* get_slots() noexcept { return impl_.get_slots(); }
static_multimap.cuh:598:    __device__ __forceinline__ pair_atomic_type const* get_slots() const noexcept
static_multimap.cuh:600:      return impl_.get_slots();
static_multimap.cuh:608:    __host__ __device__ __forceinline__ std::size_t get_capacity() const noexcept
static_multimap.cuh:610:      return impl_.get_capacity();
static_multimap.cuh:618:    __host__ __device__ __forceinline__ Key get_empty_key_sentinel() const noexcept
static_multimap.cuh:620:      return impl_.get_empty_key_sentinel();
static_multimap.cuh:628:    __host__ __device__ __forceinline__ Value get_empty_value_sentinel() const noexcept
static_multimap.cuh:630:      return impl_.get_empty_value_sentinel();
static_multimap.cuh:652:   *                  [map = m.get_device_mutable_view()]
static_multimap.cuh:1200:  std::size_t get_capacity() const noexcept { return capacity_; }
static_multimap.cuh:1208:  std::size_t get_size(cudaStream_t stream = 0) const noexcept;
static_multimap.cuh:1216:  float get_load_factor(cudaStream_t stream = 0) const noexcept;
static_multimap.cuh:1223:  Key get_empty_key_sentinel() const noexcept { return empty_key_sentinel_; }
static_multimap.cuh:1230:  Value get_empty_value_sentinel() const noexcept { return empty_value_sentinel_; }
static_multimap.cuh:1238:  device_view get_device_view() const noexcept
static_multimap.cuh:1249:  device_mutable_view get_device_mutable_view() const noexcept
detail/static_multimap/static_multimap.inl:50:  : capacity_{cuco::detail::get_valid_capacity<cg_size(), vector_width(), uses_vector_load()>(
detail/static_multimap/static_multimap.inl:63:  auto const grid_size      = (get_capacity() + stride * block_size - 1) / (stride * block_size);
detail/static_multimap/static_multimap.inl:66:    slots_.get(), empty_key_sentinel, empty_value_sentinel, get_capacity());
detail/static_multimap/static_multimap.inl:85:  auto view            = get_device_mutable_view();
detail/static_multimap/static_multimap.inl:107:  auto view            = get_device_mutable_view();
detail/static_multimap/static_multimap.inl:129:  auto view            = get_device_view();
detail/static_multimap/static_multimap.inl:152:  auto view            = get_device_view();
detail/static_multimap/static_multimap.inl:183:  auto view            = get_device_view();
detail/static_multimap/static_multimap.inl:214:  auto view            = get_device_view();
detail/static_multimap/static_multimap.inl:245:  auto view            = get_device_view();
detail/static_multimap/static_multimap.inl:277:  auto view                   = get_device_view();
detail/static_multimap/static_multimap.inl:283:  auto const grid_size = detail::get_grid_size(detail::retrieve<block_size,
detail/static_multimap/static_multimap.inl:327:  auto view                   = get_device_view();
detail/static_multimap/static_multimap.inl:333:  auto const grid_size = detail::get_grid_size(detail::retrieve<block_size,
detail/static_multimap/static_multimap.inl:384:  auto view                   = get_device_view();
detail/static_multimap/static_multimap.inl:429:  auto view                   = get_device_view();
detail/static_multimap/static_multimap.inl:480:                     source_device_view.get_slots(),
detail/static_multimap/static_multimap.inl:481:                     sizeof(pair_atomic_type) * source_device_view.get_capacity(),
detail/static_multimap/static_multimap.inl:486:  pair_atomic_type const* const slots_ptr = source_device_view.get_slots();
detail/static_multimap/static_multimap.inl:487:  for (std::size_t i = g.thread_rank(); i < source_device_view.get_capacity(); i += g.size()) {
detail/static_multimap/static_multimap.inl:497:                     source_device_view.get_capacity(),
detail/static_multimap/static_multimap.inl:498:                     source_device_view.get_empty_key_sentinel(),
detail/static_multimap/static_multimap.inl:499:                     source_device_view.get_empty_value_sentinel());
detail/static_multimap/static_multimap.inl:864:std::size_t static_multimap<Key, Value, Scope, Allocator, ProbeSequence>::get_size(
detail/static_multimap/static_multimap.inl:879:float static_multimap<Key, Value, Scope, Allocator, ProbeSequence>::get_load_factor(
detail/static_multimap/static_multimap.inl:882:  auto size = get_size(stream);
detail/static_multimap/device_view_impl.inl:148:  __host__ __device__ __forceinline__ Key get_empty_key_sentinel() const noexcept
detail/static_multimap/device_view_impl.inl:158:  __host__ __device__ __forceinline__ Value get_empty_value_sentinel() const noexcept
detail/static_multimap/device_view_impl.inl:168:  __device__ __forceinline__ pair_atomic_type* get_slots() noexcept
detail/static_multimap/device_view_impl.inl:170:    return probe_sequence_.get_slots();
detail/static_multimap/device_view_impl.inl:178:  __device__ __forceinline__ pair_atomic_type const* get_slots() const noexcept
detail/static_multimap/device_view_impl.inl:180:    return probe_sequence_.get_slots();
detail/static_multimap/device_view_impl.inl:188:  __host__ __device__ __forceinline__ std::size_t get_capacity() const noexcept
detail/static_multimap/device_view_impl.inl:190:    return probe_sequence_.get_capacity();
detail/static_multimap/device_view_impl.inl:235:    auto expected_key   = this->get_empty_key_sentinel();
detail/static_multimap/device_view_impl.inl:236:    auto expected_value = this->get_empty_value_sentinel();
detail/static_multimap/device_view_impl.inl:265:    auto expected_key   = this->get_empty_key_sentinel();
detail/static_multimap/device_view_impl.inl:266:    auto expected_value = this->get_empty_value_sentinel();
detail/static_multimap/device_view_impl.inl:280:          slot_value.compare_exchange_strong(expected_value = this->get_empty_value_sentinel(),
detail/static_multimap/device_view_impl.inl:286:      slot_value.store(this->get_empty_value_sentinel(), memory_order_relaxed);
detail/static_multimap/device_view_impl.inl:304:    auto expected_key = this->get_empty_key_sentinel();
detail/static_multimap/device_view_impl.inl:351:        (detail::bitwise_compare(arr[0].first, this->get_empty_key_sentinel()));
detail/static_multimap/device_view_impl.inl:353:        (detail::bitwise_compare(arr[1].first, this->get_empty_key_sentinel()));
detail/static_multimap/device_view_impl.inl:403:        detail::bitwise_compare(existing_key, this->get_empty_key_sentinel());
detail/static_multimap/device_view_impl.inl:588:        detail::bitwise_compare(arr[0].first, this->get_empty_key_sentinel());
detail/static_multimap/device_view_impl.inl:590:        detail::bitwise_compare(arr[1].first, this->get_empty_key_sentinel());
detail/static_multimap/device_view_impl.inl:638:        detail::bitwise_compare(existing_key, this->get_empty_key_sentinel());
detail/static_multimap/device_view_impl.inl:681:        detail::bitwise_compare(arr[0].first, this->get_empty_key_sentinel());
detail/static_multimap/device_view_impl.inl:683:        detail::bitwise_compare(arr[1].first, this->get_empty_key_sentinel());
detail/static_multimap/device_view_impl.inl:731:        detail::bitwise_compare(current_key, this->get_empty_key_sentinel());
detail/static_multimap/device_view_impl.inl:780:        detail::bitwise_compare(arr[0].first, this->get_empty_key_sentinel());
detail/static_multimap/device_view_impl.inl:782:        detail::bitwise_compare(arr[1].first, this->get_empty_key_sentinel());
detail/static_multimap/device_view_impl.inl:832:        detail::bitwise_compare(slot_contents.first, this->get_empty_key_sentinel());
detail/static_multimap/device_view_impl.inl:908:          detail::bitwise_compare(arr[0].first, this->get_empty_key_sentinel());
detail/static_multimap/device_view_impl.inl:910:          detail::bitwise_compare(arr[1].first, this->get_empty_key_sentinel());
detail/static_multimap/device_view_impl.inl:944:              output_buffer[output_idx] = cuco::make_pair(k, this->get_empty_value_sentinel());
detail/static_multimap/device_view_impl.inl:1015:        detail::bitwise_compare(slot_contents.first, this->get_empty_key_sentinel());
detail/static_multimap/device_view_impl.inl:1036:            output_buffer[output_idx] = cuco::make_pair(k, this->get_empty_value_sentinel());
detail/static_multimap/device_view_impl.inl:1115:        detail::bitwise_compare(arr[0].first, this->get_empty_key_sentinel());
detail/static_multimap/device_view_impl.inl:1117:        detail::bitwise_compare(arr[1].first, this->get_empty_key_sentinel());
detail/static_multimap/device_view_impl.inl:1153:            *(contained_key_begin) = this->get_empty_key_sentinel();
detail/static_multimap/device_view_impl.inl:1154:            *(contained_val_begin) = this->get_empty_value_sentinel();
detail/static_multimap/device_view_impl.inl:1229:        detail::bitwise_compare(slot_contents.first, this->get_empty_key_sentinel());
detail/static_multimap/device_view_impl.inl:1252:            *(contained_key_begin) = this->get_empty_key_sentinel();
detail/static_multimap/device_view_impl.inl:1253:            *(contained_val_begin) = this->get_empty_value_sentinel();
detail/static_multimap/device_view_impl.inl:1328:          detail::bitwise_compare(arr[0].first, this->get_empty_key_sentinel());
detail/static_multimap/device_view_impl.inl:1330:          detail::bitwise_compare(arr[1].first, this->get_empty_key_sentinel());
detail/static_multimap/device_view_impl.inl:1367:                cuco::make_pair(this->get_empty_key_sentinel(), this->get_empty_value_sentinel());
detail/static_multimap/device_view_impl.inl:1453:        detail::bitwise_compare(slot_contents.first, this->get_empty_key_sentinel());
detail/static_multimap/device_view_impl.inl:1477:              cuco::make_pair(this->get_empty_key_sentinel(), this->get_empty_value_sentinel());
detail/probe_sequence_impl.cuh:115:  __host__ __device__ __forceinline__ std::size_t get_capacity() const noexcept
detail/probe_sequence_impl.cuh:123:  __device__ __forceinline__ iterator get_slots() noexcept { return slots_; }
detail/probe_sequence_impl.cuh:128:  __device__ __forceinline__ const_iterator get_slots() const noexcept { return slots_; }
detail/dynamic_map.inl:37:  submap_views_.push_back(submaps_[0]->get_device_view());
detail/dynamic_map.inl:38:  submap_mutable_views_.push_back(submaps_[0]->get_device_mutable_view());
detail/dynamic_map.inl:59:      submap_capacity = submaps_[submap_idx]->get_capacity();
detail/dynamic_map.inl:69:      submap_views_.push_back(submaps_[submap_idx]->get_device_view());
detail/dynamic_map.inl:70:      submap_mutable_views_.push_back(submaps_[submap_idx]->get_device_mutable_view());
detail/dynamic_map.inl:93:      max_load_factor_ * submaps_[submap_idx]->get_capacity() - submaps_[submap_idx]->get_size();
detail/static_map.inl:100:  auto view             = get_device_mutable_view();
detail/static_map.inl:138:  auto view            = get_device_mutable_view();
detail/static_map.inl:159:  CUCO_RUNTIME_EXPECTS(get_empty_key_sentinel() != get_erased_key_sentinel(),
detail/static_map.inl:169:  auto view            = get_device_mutable_view();
detail/static_map.inl:202:  auto view             = get_device_view();
detail/static_map.inl:217:  auto end    = begin + get_capacity();
detail/static_map.inl:218:  auto filled = detail::slot_is_filled<Key>{get_empty_key_sentinel()};
detail/static_map.inl:243:  auto view             = get_device_view();
detail/static_map.inl:258:  auto expected_value = this->get_empty_value_sentinel();
detail/static_map.inl:292:  auto expected_value = this->get_empty_value_sentinel();
detail/static_map.inl:306:        slot_value.compare_exchange_strong(expected_value = this->get_empty_value_sentinel(),
detail/static_map.inl:312:    slot_value.store(this->get_empty_value_sentinel(), memory_order_relaxed);
detail/static_map.inl:361:      detail::bitwise_compare(existing_key, this->get_empty_key_sentinel()) or
detail/static_map.inl:362:      detail::bitwise_compare(existing_key, this->get_erased_key_sentinel());
detail/static_map.inl:408:      detail::bitwise_compare(existing_key, this->get_empty_key_sentinel()) or
detail/static_map.inl:409:      detail::bitwise_compare(existing_key, this->get_erased_key_sentinel());
detail/static_map.inl:467:    make_pair<Key, Value>(this->get_erased_key_sentinel(), this->get_empty_value_sentinel());
detail/static_map.inl:478:    if (detail::bitwise_compare(existing_key, this->get_empty_key_sentinel())) { return false; }
detail/static_map.inl:512:    make_pair<Key, Value>(this->get_erased_key_sentinel(), this->get_empty_value_sentinel());
detail/static_map.inl:523:      detail::bitwise_compare(existing_key, this->get_empty_key_sentinel());
detail/static_map.inl:575:    if (detail::bitwise_compare(existing_key, this->get_empty_key_sentinel())) {
detail/static_map.inl:598:    if (detail::bitwise_compare(existing_key, this->get_empty_key_sentinel())) {
detail/static_map.inl:625:      detail::bitwise_compare(existing_key, this->get_empty_key_sentinel());
detail/static_map.inl:663:      detail::bitwise_compare(existing_key, this->get_empty_key_sentinel());
detail/static_map.inl:718:      detail::bitwise_compare(existing_key, this->get_empty_key_sentinel());
detail/utils.hpp:40:auto get_grid_size(Kernel kernel, std::size_t block_size, std::size_t dynamic_smem_bytes = 0)
detail/static_map_kernels.cuh:346:                                 ? view.get_empty_value_sentinel()
detail/static_map_kernels.cuh:409:        found == view.end() ? view.get_empty_value_sentinel()
detail/dynamic_map_kernels.cuh:227:  auto empty_value_sentinel = submap_views[0].get_empty_value_sentinel();
detail/dynamic_map_kernels.cuh:303:  auto empty_value_sentinel = submap_views[0].get_empty_value_sentinel();
detail/prime.hpp:20181:constexpr std::size_t get_valid_capacity(std::size_t capacity) noexcept
dynamic_map.cuh:233:  std::size_t get_size() const noexcept { return size_; }
dynamic_map.cuh:240:  std::size_t get_capacity() const noexcept { return capacity_; }
dynamic_map.cuh:247:  float get_load_factor() const noexcept { return static_cast<float>(size_) / capacity_; }
static_map.cuh:115: * kernel<<<...>>>(m.get_device_view());
static_map.cuh:309:   *  - `get_size()` is reduced by the total number of erased keys
static_map.cuh:372:   * `get_size()`
static_map.cuh:604:    __host__ __device__ pair_atomic_type* get_slots() noexcept { return slots_; }
static_map.cuh:611:    __host__ __device__ pair_atomic_type const* get_slots() const noexcept { return slots_; }
static_map.cuh:618:    __host__ __device__ std::size_t get_capacity() const noexcept { return capacity_; }
static_map.cuh:625:    __host__ __device__ Key get_empty_key_sentinel() const noexcept { return empty_key_sentinel_; }
static_map.cuh:632:    __host__ __device__ Value get_empty_value_sentinel() const noexcept
static_map.cuh:637:    __host__ __device__ Key get_erased_key_sentinel() const noexcept
static_map.cuh:722:   *                  [map = m.get_mutable_device_view()]
static_map.cuh:970:      : device_view_base{mutable_map.get_slots(),
static_map.cuh:971:                         mutable_map.get_capacity(),
static_map.cuh:972:                         mutable_map.get_empty_key_sentinel(),
static_map.cuh:973:                         mutable_map.get_empty_value_sentinel(),
static_map.cuh:974:                         mutable_map.get_erased_key_sentinel()}
static_map.cuh:1027:                         source_device_view.get_slots(),
static_map.cuh:1028:                         sizeof(pair_atomic_type) * source_device_view.get_capacity(),
static_map.cuh:1033:      pair_atomic_type const* const slots_ptr = source_device_view.get_slots();
static_map.cuh:1034:      for (std::size_t i = g.thread_rank(); i < source_device_view.get_capacity(); i += g.size()) {
static_map.cuh:1045:        source_device_view.get_capacity(),
static_map.cuh:1046:        sentinel::empty_key<Key>{source_device_view.get_empty_key_sentinel()},
static_map.cuh:1047:        sentinel::empty_value<Value>{source_device_view.get_empty_value_sentinel()},
static_map.cuh:1048:        sentinel::erased_key<Key>{source_device_view.get_erased_key_sentinel()});
static_map.cuh:1199:  std::size_t get_capacity() const noexcept { return capacity_; }
static_map.cuh:1206:  std::size_t get_size() const noexcept { return size_; }
static_map.cuh:1213:  float get_load_factor() const noexcept { return static_cast<float>(size_) / capacity_; }
static_map.cuh:1220:  Key get_empty_key_sentinel() const noexcept { return empty_key_sentinel_; }
static_map.cuh:1227:  Value get_empty_value_sentinel() const noexcept { return empty_value_sentinel_; }
static_map.cuh:1234:  Key get_erased_key_sentinel() const noexcept { return erased_key_sentinel_; }
static_map.cuh:1241:  device_view get_device_view() const noexcept
static_map.cuh:1255:  device_mutable_view get_device_mutable_view() const noexcept

Basically, we want to remove all get_ prefixes listed above.

@jrhemstad jrhemstad added type: feature request New feature request and removed improvement labels May 19, 2022
@PointKernel PointKernel added the P2: Nice to have Desired, but not necessary label Jun 4, 2022
@PointKernel
Copy link
Member Author

Close as the issue is no longer relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers P2: Nice to have Desired, but not necessary type: feature request New feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants