diff --git a/include/cuco/dynamic_map.cuh b/include/cuco/dynamic_map.cuh index bf3c7c8a2..aedb81f1a 100644 --- a/include/cuco/dynamic_map.cuh +++ b/include/cuco/dynamic_map.cuh @@ -18,8 +18,8 @@ #include #include -#include #include +#include #include #include diff --git a/include/cuco/operator.hpp b/include/cuco/operator.hpp index 8199e23c6..418148eb5 100644 --- a/include/cuco/operator.hpp +++ b/include/cuco/operator.hpp @@ -24,37 +24,37 @@ inline namespace op { * @brief `insert` operator tag */ struct insert_tag { -} inline constexpr insert; +} inline constexpr insert; ///< `cuco::insert` operator /** * @brief `insert_and_find` operator tag */ struct insert_and_find_tag { -} inline constexpr insert_and_find; +} inline constexpr insert_and_find; ///< `cuco::insert_and_find` operator /** * @brief `insert_or_assign` operator tag */ struct insert_or_assign_tag { -} inline constexpr insert_or_assign; +} inline constexpr insert_or_assign; ///< `cuco::insert_or_assign` operator /** * @brief `erase` operator tag */ struct erase_tag { -} inline constexpr erase; +} inline constexpr erase; ///< `cuco::erase` operator /** * @brief `contains` operator tag */ struct contains_tag { -} inline constexpr contains; +} inline constexpr contains; ///< `cuco::contains` operator /** * @brief `find` operator tag */ struct find_tag { -} inline constexpr find; +} inline constexpr find; ///< `cuco::find` operator } // namespace op } // namespace cuco diff --git a/include/cuco/static_map.cuh b/include/cuco/static_map.cuh index 02434eb25..324c56ced 100644 --- a/include/cuco/static_map.cuh +++ b/include/cuco/static_map.cuh @@ -22,8 +22,8 @@ #include #include #include -#include #include +#include #include #include #include diff --git a/include/cuco/static_map_ref.cuh b/include/cuco/static_map_ref.cuh index 953507a6a..80c60711d 100644 --- a/include/cuco/static_map_ref.cuh +++ b/include/cuco/static_map_ref.cuh @@ -20,8 +20,8 @@ #include #include #include -#include #include +#include #include #include diff --git a/include/cuco/static_multimap.cuh b/include/cuco/static_multimap.cuh index 1d6e67df0..abdb747d0 100644 --- a/include/cuco/static_multimap.cuh +++ b/include/cuco/static_multimap.cuh @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include diff --git a/include/cuco/static_multiset.cuh b/include/cuco/static_multiset.cuh index b4a684bcc..5d16857cf 100644 --- a/include/cuco/static_multiset.cuh +++ b/include/cuco/static_multiset.cuh @@ -21,9 +21,9 @@ #include #include #include -#include #include #include +#include #include #include #include diff --git a/include/cuco/static_multiset_ref.cuh b/include/cuco/static_multiset_ref.cuh index 975ca915b..a8b5bff62 100644 --- a/include/cuco/static_multiset_ref.cuh +++ b/include/cuco/static_multiset_ref.cuh @@ -20,8 +20,8 @@ #include #include #include -#include #include +#include #include #include diff --git a/include/cuco/static_set.cuh b/include/cuco/static_set.cuh index 7c819668e..2aaee75d6 100644 --- a/include/cuco/static_set.cuh +++ b/include/cuco/static_set.cuh @@ -21,9 +21,9 @@ #include #include #include -#include #include #include +#include #include #include #include diff --git a/include/cuco/static_set_ref.cuh b/include/cuco/static_set_ref.cuh index f2f661190..004b6b92f 100644 --- a/include/cuco/static_set_ref.cuh +++ b/include/cuco/static_set_ref.cuh @@ -20,8 +20,8 @@ #include #include #include -#include #include +#include #include #include diff --git a/include/cuco/sentinel.cuh b/include/cuco/types.cuh similarity index 70% rename from include/cuco/sentinel.cuh rename to include/cuco/types.cuh index b71d3e6c5..f0c579f85 100644 --- a/include/cuco/sentinel.cuh +++ b/include/cuco/types.cuh @@ -18,6 +18,16 @@ #include +/** + * @brief Defines various strong type wrappers used across this library. + * + * @note Each strong type inherits from `cuco::detail::strong_type`. `CUCO_DEFINE_STRONG_TYPE` + * and `CUCO_DEFINE_TEMPLATE_STRONG_TYPE` are convenience macros used to define a named type in a + * single line, e.g., `CUCO_DEFINE_STRONG_TYPE(foo, double)` defines `struct foo : public + * cuco::detail::strong_type {...};`, where `cuco::foo{42.0}` is implicitly convertible to + * `double{42.0}`. + */ + namespace cuco { /** * @brief A strong type wrapper `cuco::empty_key` used to denote the empty key sentinel. diff --git a/include/cuco/utility/allocator.hpp b/include/cuco/utility/allocator.hpp index 583571620..060ae0dd8 100644 --- a/include/cuco/utility/allocator.hpp +++ b/include/cuco/utility/allocator.hpp @@ -60,12 +60,31 @@ class cuda_allocator { void deallocate(value_type* p, std::size_t) { CUCO_CUDA_TRY(cudaFree(p)); } }; +/** + * @brief Equality comparison operator. + * + * @tparam T Value type of LHS object + * @tparam U Value type of RHS object + * + * @return `true` iff given arguments are equal + */ template bool operator==(cuda_allocator const&, cuda_allocator const&) noexcept { return true; } +/** + * @brief Inequality comparison operator. + * + * @tparam T Value type of LHS object + * @tparam U Value type of RHS object + * + * @param lhs Left-hand side object to compare + * @param rhs Right-hand side object to compare + * + * @return `true` iff given arguments are not equal + */ template bool operator!=(cuda_allocator const& lhs, cuda_allocator const& rhs) noexcept { diff --git a/include/cuco/utility/cuda_thread_scope.cuh b/include/cuco/utility/cuda_thread_scope.cuh index 4e2242487..906605a14 100644 --- a/include/cuco/utility/cuda_thread_scope.cuh +++ b/include/cuco/utility/cuda_thread_scope.cuh @@ -36,9 +36,13 @@ struct cuda_thread_scope { }; // alias definitions -inline constexpr auto thread_scope_system = cuda_thread_scope{}; -inline constexpr auto thread_scope_device = cuda_thread_scope{}; -inline constexpr auto thread_scope_block = cuda_thread_scope{}; -inline constexpr auto thread_scope_thread = cuda_thread_scope{}; +inline constexpr auto thread_scope_system = + cuda_thread_scope{}; ///< `cuco::thread_scope_system` +inline constexpr auto thread_scope_device = + cuda_thread_scope{}; ///< `cuco::thread_scope_device` +inline constexpr auto thread_scope_block = + cuda_thread_scope{}; ///< `cuco::thread_scope_block` +inline constexpr auto thread_scope_thread = + cuda_thread_scope{}; ///< `cuco::thread_scope_thread` } // namespace cuco diff --git a/include/cuco/utility/traits.hpp b/include/cuco/utility/traits.hpp index dcbfe432a..1325b3a52 100644 --- a/include/cuco/utility/traits.hpp +++ b/include/cuco/utility/traits.hpp @@ -46,7 +46,8 @@ struct is_bitwise_comparable -inline constexpr bool is_bitwise_comparable_v = is_bitwise_comparable::value; +inline constexpr bool is_bitwise_comparable_v = + is_bitwise_comparable::value; ///< Shortcut definition /** * @brief Declares that a type `Type` is bitwise comparable. @@ -59,9 +60,11 @@ inline constexpr bool is_bitwise_comparable_v = is_bitwise_comparable::value; } template -inline constexpr bool dependent_bool_value = value; +inline constexpr bool dependent_bool_value = value; ///< Unpacked dependent bool value template -inline constexpr bool dependent_false = dependent_bool_value; +inline constexpr bool dependent_false = + dependent_bool_value; ///< Emits a `false` value which is dependent on the given + ///< argument types } // namespace cuco