diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5679bf67f..bc94a9be6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,11 +10,10 @@ ci: repos: - repo: https://github.com/pre-commit/mirrors-clang-format - rev: v13.0.0 + rev: v16.0.6 hooks: - id: clang-format - files: \.(cu|cuh|h|hpp|cpp|inl)$ - 'types_or': [file] + types_or: [c, c++, cuda] args: ['-fallback-style=none', '-style=file', '-i'] - repo: local hooks: diff --git a/include/cuco/aow_storage.cuh b/include/cuco/aow_storage.cuh index e18221f19..7f9de013d 100644 --- a/include/cuco/aow_storage.cuh +++ b/include/cuco/aow_storage.cuh @@ -92,7 +92,7 @@ class aow_storage : public detail::aow_storage_base { aow_storage& operator=(aow_storage&&) = default; ~aow_storage() = default; ///< Destructor - aow_storage(aow_storage const&) = delete; + aow_storage(aow_storage const&) = delete; aow_storage& operator=(aow_storage const&) = delete; /** diff --git a/include/cuco/detail/extent/extent.inl b/include/cuco/detail/extent/extent.inl index 01299d926..545c9f71d 100644 --- a/include/cuco/detail/extent/extent.inl +++ b/include/cuco/detail/extent/extent.inl @@ -117,12 +117,10 @@ template namespace detail { template -struct is_window_extent : std::false_type { -}; +struct is_window_extent : std::false_type {}; template -struct is_window_extent> : std::true_type { -}; +struct is_window_extent> : std::true_type {}; template inline constexpr bool is_window_extent_v = is_window_extent::value; diff --git a/include/cuco/detail/pair/tuple_helpers.inl b/include/cuco/detail/pair/tuple_helpers.inl index 29be199ee..b0ca39d14 100644 --- a/include/cuco/detail/pair/tuple_helpers.inl +++ b/include/cuco/detail/pair/tuple_helpers.inl @@ -15,20 +15,16 @@ */ template -struct tuple_size> : integral_constant { -}; +struct tuple_size> : integral_constant {}; template -struct tuple_size> : tuple_size> { -}; +struct tuple_size> : tuple_size> {}; template -struct tuple_size> : tuple_size> { -}; +struct tuple_size> : tuple_size> {}; template -struct tuple_size> : tuple_size> { -}; +struct tuple_size> : tuple_size> {}; template struct tuple_element> { @@ -46,20 +42,16 @@ struct tuple_element<1, cuco::pair> { }; template -struct tuple_element<0, const cuco::pair> : tuple_element<0, cuco::pair> { -}; +struct tuple_element<0, const cuco::pair> : tuple_element<0, cuco::pair> {}; template -struct tuple_element<1, const cuco::pair> : tuple_element<1, cuco::pair> { -}; +struct tuple_element<1, const cuco::pair> : tuple_element<1, cuco::pair> {}; template -struct tuple_element<0, volatile cuco::pair> : tuple_element<0, cuco::pair> { -}; +struct tuple_element<0, volatile cuco::pair> : tuple_element<0, cuco::pair> {}; template -struct tuple_element<1, volatile cuco::pair> : tuple_element<1, cuco::pair> { -}; +struct tuple_element<1, volatile cuco::pair> : tuple_element<1, cuco::pair> {}; template struct tuple_element<0, const volatile cuco::pair> : tuple_element<0, cuco::pair> { diff --git a/include/cuco/detail/traits.hpp b/include/cuco/detail/traits.hpp index 9154c736a..31c9659cd 100644 --- a/include/cuco/detail/traits.hpp +++ b/include/cuco/detail/traits.hpp @@ -25,20 +25,17 @@ namespace cuco::detail { template -struct is_std_pair_like : cuda::std::false_type { -}; +struct is_std_pair_like : cuda::std::false_type {}; template struct is_std_pair_like(cuda::std::declval())), decltype(std::get<1>(cuda::std::declval()))>> : cuda::std:: - conditional_t::value == 2, cuda::std::true_type, cuda::std::false_type> { -}; + conditional_t::value == 2, cuda::std::true_type, cuda::std::false_type> {}; template -struct is_cuda_std_pair_like : cuda::std::false_type { -}; +struct is_cuda_std_pair_like : cuda::std::false_type {}; template struct is_cuda_std_pair_like< @@ -47,12 +44,10 @@ struct is_cuda_std_pair_like< decltype(cuda::std::get<1>(cuda::std::declval()))>> : cuda::std::conditional_t::value == 2, cuda::std::true_type, - cuda::std::false_type> { -}; + cuda::std::false_type> {}; template -struct is_thrust_pair_like_impl : cuda::std::false_type { -}; +struct is_thrust_pair_like_impl : cuda::std::false_type {}; template struct is_thrust_pair_like_impl< @@ -61,13 +56,11 @@ struct is_thrust_pair_like_impl< decltype(thrust::get<1>(cuda::std::declval()))>> : cuda::std::conditional_t::value == 2, cuda::std::true_type, - cuda::std::false_type> { -}; + cuda::std::false_type> {}; template struct is_thrust_pair_like : is_thrust_pair_like_impl()))>> { -}; + cuda::std::declval()))>> {}; } // namespace cuco::detail diff --git a/include/cuco/dynamic_map.cuh b/include/cuco/dynamic_map.cuh index 000ef7de8..bf3c7c8a2 100644 --- a/include/cuco/dynamic_map.cuh +++ b/include/cuco/dynamic_map.cuh @@ -117,7 +117,7 @@ class dynamic_map { dynamic_map(dynamic_map&&) = delete; dynamic_map& operator=(dynamic_map const&) = delete; - dynamic_map& operator=(dynamic_map&&) = delete; + dynamic_map& operator=(dynamic_map&&) = delete; /** * @brief Constructs a dynamically-sized map with the specified initial capacity, growth factor diff --git a/include/cuco/static_map.cuh b/include/cuco/static_map.cuh index 187f930e8..02434eb25 100644 --- a/include/cuco/static_map.cuh +++ b/include/cuco/static_map.cuh @@ -138,7 +138,7 @@ class static_map { storage_ref_type, Operators...>; ///< Non-owning container ref type - static_map(static_map const&) = delete; + static_map(static_map const&) = delete; static_map& operator=(static_map const&) = delete; static_map(static_map&&) = default; ///< Move constructor @@ -866,7 +866,7 @@ class static_map { static_map(static_map&&) = delete; static_map& operator=(static_map const&) = delete; - static_map& operator=(static_map&&) = delete; + static_map& operator=(static_map&&) = delete; /** * @brief Indicates if concurrent insert/find is supported for the key/value types. diff --git a/include/cuco/static_multimap.cuh b/include/cuco/static_multimap.cuh index 42f7cf80a..faae49129 100644 --- a/include/cuco/static_multimap.cuh +++ b/include/cuco/static_multimap.cuh @@ -165,7 +165,7 @@ class static_multimap { using probe_sequence_type = cuco::legacy::detail::probe_sequence; ///< Probe scheme type - static_multimap(static_multimap const&) = delete; + static_multimap(static_multimap const&) = delete; static_multimap& operator=(static_multimap const&) = delete; static_multimap(static_multimap&&) = default; ///< Move constructor diff --git a/include/cuco/static_set.cuh b/include/cuco/static_set.cuh index c420d3ce0..88b6f1991 100644 --- a/include/cuco/static_set.cuh +++ b/include/cuco/static_set.cuh @@ -114,7 +114,7 @@ class static_set { storage_ref_type, Operators...>; ///< Non-owning container ref type - static_set(static_set const&) = delete; + static_set(static_set const&) = delete; static_set& operator=(static_set const&) = delete; static_set(static_set&&) = default; ///< Move constructor diff --git a/include/cuco/utility/key_generator.cuh b/include/cuco/utility/key_generator.cuh index 07e22dcb1..3e72fcaba 100644 --- a/include/cuco/utility/key_generator.cuh +++ b/include/cuco/utility/key_generator.cuh @@ -41,8 +41,7 @@ namespace distribution { /** * @brief Tag struct representing a random distribution of unique keys. */ -struct unique { -}; +struct unique {}; /** * @brief Tag struct representing a uniform distribution. diff --git a/include/cuco/utility/traits.hpp b/include/cuco/utility/traits.hpp index 1a6252dcb..dcbfe432a 100644 --- a/include/cuco/utility/traits.hpp +++ b/include/cuco/utility/traits.hpp @@ -38,14 +38,12 @@ namespace cuco { * */ template -struct is_bitwise_comparable : std::false_type { -}; +struct is_bitwise_comparable : std::false_type {}; /// By default, only types with unique object representations are allowed template struct is_bitwise_comparable>> - : std::true_type { -}; + : std::true_type {}; template inline constexpr bool is_bitwise_comparable_v = is_bitwise_comparable::value; @@ -54,11 +52,10 @@ inline constexpr bool is_bitwise_comparable_v = is_bitwise_comparable::value; * @brief Declares that a type `Type` is bitwise comparable. * */ -#define CUCO_DECLARE_BITWISE_COMPARABLE(Type) \ - namespace cuco { \ - template <> \ - struct is_bitwise_comparable : std::true_type { \ - }; \ +#define CUCO_DECLARE_BITWISE_COMPARABLE(Type) \ + namespace cuco { \ + template <> \ + struct is_bitwise_comparable : std::true_type {}; \ } template