From c74bae45e2354cdecf387829f4177f769fe47de6 Mon Sep 17 00:00:00 2001 From: Yunsong Wang Date: Mon, 2 Dec 2024 15:14:04 -0800 Subject: [PATCH] Reorder namespaces --- .../detail/bloom_filter/bloom_filter_impl.cuh | 4 +-- include/cuco/detail/bloom_filter/kernels.cuh | 4 +-- .../cuco/detail/open_addressing/functors.cuh | 4 +-- .../cuco/detail/open_addressing/kernels.cuh | 4 +-- .../open_addressing/open_addressing_impl.cuh | 32 +++++++++---------- include/cuco/detail/static_map/helpers.cuh | 4 +-- include/cuco/detail/static_map/kernels.cuh | 4 +-- include/cuco/detail/static_map/static_map.inl | 6 ++-- tests/static_map/insert_or_apply_test.cu | 2 +- 9 files changed, 32 insertions(+), 32 deletions(-) diff --git a/include/cuco/detail/bloom_filter/bloom_filter_impl.cuh b/include/cuco/detail/bloom_filter/bloom_filter_impl.cuh index d1a81affd..c2393b29e 100644 --- a/include/cuco/detail/bloom_filter/bloom_filter_impl.cuh +++ b/include/cuco/detail/bloom_filter/bloom_filter_impl.cuh @@ -198,7 +198,7 @@ class bloom_filter_impl { auto const grid_size = cuco::detail::grid_size(num_keys, cg_size, cuco::detail::default_stride(), block_size); - bloom_filter_ns::detail::add_if_n + detail::bloom_filter_ns::add_if_n <<>>(first, num_keys, stencil, pred, *this); } @@ -303,7 +303,7 @@ class bloom_filter_impl { auto const grid_size = cuco::detail::grid_size(num_keys, cg_size, cuco::detail::default_stride(), block_size); - bloom_filter_ns::detail::contains_if_n + detail::bloom_filter_ns::contains_if_n <<>>( first, num_keys, stencil, pred, output_begin, *this); } diff --git a/include/cuco/detail/bloom_filter/kernels.cuh b/include/cuco/detail/bloom_filter/kernels.cuh index 6b02af322..b0ef7b684 100644 --- a/include/cuco/detail/bloom_filter/kernels.cuh +++ b/include/cuco/detail/bloom_filter/kernels.cuh @@ -22,7 +22,7 @@ #include #include -namespace cuco::bloom_filter_ns::detail { +namespace cuco::detail::bloom_filter_ns { CUCO_SUPPRESS_KERNEL_WARNINGS @@ -89,4 +89,4 @@ CUCO_KERNEL __launch_bounds__(BlockSize) void contains_if_n(InputIt first, } } -} // namespace cuco::bloom_filter_ns::detail +} // namespace cuco::detail::bloom_filter_ns diff --git a/include/cuco/detail/open_addressing/functors.cuh b/include/cuco/detail/open_addressing/functors.cuh index b94f80226..14fa61f6f 100644 --- a/include/cuco/detail/open_addressing/functors.cuh +++ b/include/cuco/detail/open_addressing/functors.cuh @@ -18,7 +18,7 @@ #include #include -namespace cuco::open_addressing_ns::detail { +namespace cuco::detail::open_addressing_ns { /** * @brief Device functor returning the content of the slot indexed by `idx` @@ -107,4 +107,4 @@ struct slot_is_filled { } }; -} // namespace cuco::open_addressing_ns::detail +} // namespace cuco::detail::open_addressing_ns diff --git a/include/cuco/detail/open_addressing/kernels.cuh b/include/cuco/detail/open_addressing/kernels.cuh index c93edc5f4..3842ffaa7 100644 --- a/include/cuco/detail/open_addressing/kernels.cuh +++ b/include/cuco/detail/open_addressing/kernels.cuh @@ -25,7 +25,7 @@ #include -namespace cuco::open_addressing_ns::detail { +namespace cuco::detail::open_addressing_ns { CUCO_SUPPRESS_KERNEL_WARNINGS /** @@ -729,4 +729,4 @@ CUCO_KERNEL __launch_bounds__(BlockSize) void rehash( } } -} // namespace cuco::open_addressing_ns::detail +} // namespace cuco::detail::open_addressing_ns diff --git a/include/cuco/detail/open_addressing/open_addressing_impl.cuh b/include/cuco/detail/open_addressing/open_addressing_impl.cuh index cdec2c019..aece06a12 100644 --- a/include/cuco/detail/open_addressing/open_addressing_impl.cuh +++ b/include/cuco/detail/open_addressing/open_addressing_impl.cuh @@ -342,7 +342,7 @@ class open_addressing_impl { auto const grid_size = cuco::detail::grid_size(num_keys, cg_size); - open_addressing_ns::detail::insert_if_n + detail::open_addressing_ns::insert_if_n <<>>( first, num_keys, stencil, pred, counter.data(), container_ref); @@ -384,7 +384,7 @@ class open_addressing_impl { auto const grid_size = cuco::detail::grid_size(num_keys, cg_size); - open_addressing_ns::detail::insert_if_n + detail::open_addressing_ns::insert_if_n <<>>( first, num_keys, stencil, pred, container_ref); } @@ -426,7 +426,7 @@ class open_addressing_impl { auto const grid_size = cuco::detail::grid_size(num_keys, cg_size); - open_addressing_ns::detail::insert_and_find + detail::open_addressing_ns::insert_and_find <<>>( first, num_keys, found_begin, inserted_begin, container_ref); } @@ -466,7 +466,7 @@ class open_addressing_impl { auto const grid_size = cuco::detail::grid_size(num_keys, cg_size); - open_addressing_ns::detail::erase + detail::open_addressing_ns::erase <<>>( first, num_keys, container_ref); } @@ -540,7 +540,7 @@ class open_addressing_impl { auto const grid_size = cuco::detail::grid_size(num_keys, cg_size); - open_addressing_ns::detail::contains_if_n + detail::open_addressing_ns::contains_if_n <<>>( first, num_keys, stencil, pred, output_begin, container_ref); } @@ -615,7 +615,7 @@ class open_addressing_impl { auto const grid_size = cuco::detail::grid_size(num_keys, cg_size); - open_addressing_ns::detail::find_if_n + detail::open_addressing_ns::find_if_n <<>>( first, num_keys, stencil, pred, output_begin, container_ref); } @@ -789,8 +789,8 @@ class open_addressing_impl { std::min(static_cast(this->capacity()) - offset, stride); auto const begin = thrust::make_transform_iterator( thrust::counting_iterator{static_cast(offset)}, - open_addressing_ns::detail::get_slot(this->storage_ref())); - auto const is_filled = open_addressing_ns::detail::slot_is_filled{ + detail::open_addressing_ns::get_slot(this->storage_ref())); + auto const is_filled = detail::open_addressing_ns::slot_is_filled{ this->empty_key_sentinel(), this->erased_key_sentinel()}; std::size_t temp_storage_bytes = 0; @@ -844,7 +844,7 @@ class open_addressing_impl { template void for_each_async(CallbackOp&& callback_op, cuda::stream_ref stream) const { - auto const is_filled = open_addressing_ns::detail::slot_is_filled{ + auto const is_filled = detail::open_addressing_ns::slot_is_filled{ this->empty_key_sentinel(), this->erased_key_sentinel()}; auto storage_ref = this->storage_ref(); @@ -886,7 +886,7 @@ class open_addressing_impl { auto const grid_size = cuco::detail::grid_size(num_keys, cg_size); - open_addressing_ns::detail::for_each_n + detail::open_addressing_ns::for_each_n <<>>( first, num_keys, std::forward(callback_op), container_ref); } @@ -907,12 +907,12 @@ class open_addressing_impl { counter.reset(stream); auto const grid_size = cuco::detail::grid_size(storage_.num_buckets()); - auto const is_filled = open_addressing_ns::detail::slot_is_filled{ + auto const is_filled = detail::open_addressing_ns::slot_is_filled{ this->empty_key_sentinel(), this->erased_key_sentinel()}; // TODO: custom kernel to be replaced by cub::DeviceReduce::Sum when cub version is bumped to // v2.1.0 - open_addressing_ns::detail::size + detail::open_addressing_ns::size <<>>( storage_.ref(), is_filled, counter.data()); @@ -1014,10 +1014,10 @@ class open_addressing_impl { auto constexpr block_size = cuco::detail::default_block_size(); auto constexpr stride = cuco::detail::default_stride(); auto const grid_size = cuco::detail::grid_size(num_buckets, 1, stride, block_size); - auto const is_filled = open_addressing_ns::detail::slot_is_filled{ + auto const is_filled = detail::open_addressing_ns::slot_is_filled{ this->empty_key_sentinel(), this->erased_key_sentinel()}; - open_addressing_ns::detail::rehash<<>>( + detail::open_addressing_ns::rehash<<>>( old_storage.ref(), container.ref(op::insert), is_filled); } @@ -1120,7 +1120,7 @@ class open_addressing_impl { auto const grid_size = cuco::detail::grid_size(num_keys, cg_size); - open_addressing_ns::detail::count + detail::open_addressing_ns::count <<>>( first, num_keys, counter.data(), container_ref); @@ -1180,7 +1180,7 @@ class open_addressing_impl { auto constexpr grid_stride = 1; auto const grid_size = cuco::detail::grid_size(n, cg_size, grid_stride, block_size); - open_addressing_ns::detail::retrieve + detail::open_addressing_ns::retrieve <<>>( first, n, output_probe, output_match, counter.data(), container_ref); diff --git a/include/cuco/detail/static_map/helpers.cuh b/include/cuco/detail/static_map/helpers.cuh index 9627f4c9c..6eedae810 100644 --- a/include/cuco/detail/static_map/helpers.cuh +++ b/include/cuco/detail/static_map/helpers.cuh @@ -18,7 +18,7 @@ #include #include -namespace cuco::static_map_ns::detail { +namespace cuco::detail::static_map_ns { /** * @brief Dispatches to shared memory map kernel if `num_elements_per_thread > 2`, else @@ -112,4 +112,4 @@ void dispatch_insert_or_apply( first, num, init, op, ref); } } -} // namespace cuco::static_map_ns::detail \ No newline at end of file +} // namespace cuco::detail::static_map_ns diff --git a/include/cuco/detail/static_map/kernels.cuh b/include/cuco/detail/static_map/kernels.cuh index 5c468ba37..dee450ff4 100644 --- a/include/cuco/detail/static_map/kernels.cuh +++ b/include/cuco/detail/static_map/kernels.cuh @@ -26,7 +26,7 @@ #include -namespace cuco::static_map_ns::detail { +namespace cuco::detail::static_map_ns { CUCO_SUPPRESS_KERNEL_WARNINGS // TODO user insert_or_assign internally @@ -262,4 +262,4 @@ CUCO_KERNEL __launch_bounds__(BlockSize) void insert_or_apply_shmem( } } } -} // namespace cuco::static_map_ns::detail +} // namespace cuco::detail::static_map_ns diff --git a/include/cuco/detail/static_map/static_map.inl b/include/cuco/detail/static_map/static_map.inl index 7c69263d2..67f7cfa94 100644 --- a/include/cuco/detail/static_map/static_map.inl +++ b/include/cuco/detail/static_map/static_map.inl @@ -284,7 +284,7 @@ void static_map + detail::static_map_ns::insert_or_assign <<>>( first, num, ref(op::insert_or_assign)); } @@ -335,7 +335,7 @@ void static_mapempty_value_sentinel(); // use empty_sentinel as unused init value - static_map_ns::detail::dispatch_insert_or_apply( + detail::static_map_ns::dispatch_insert_or_apply( first, last, init, op, ref(op::insert_or_apply), stream); } @@ -353,7 +353,7 @@ void static_map( + detail::static_map_ns::dispatch_insert_or_apply( first, last, init, op, ref(op::insert_or_apply), stream); } diff --git a/tests/static_map/insert_or_apply_test.cu b/tests/static_map/insert_or_apply_test.cu index 9663c95a3..03d8ce5c9 100644 --- a/tests/static_map/insert_or_apply_test.cu +++ b/tests/static_map/insert_or_apply_test.cu @@ -115,7 +115,7 @@ void test_insert_or_apply_shmem(Map& map, size_type num_keys, size_type num_uniq cuda::stream_ref stream{}; // launch the shmem kernel - cuco::static_map_ns::detail:: + cuco::detail::static_map_ns:: insert_or_apply_shmem <<>>(pairs_begin, num_keys,